/** * Overloads a child definition with a given parent. * All attributes present in child are kept. All missing attributes are * copied from the parent. * Special attribute 'template','role' and 'extends' are overloaded in child * if not defined * * @param parent The parent definition. * @param child The child that will be overloaded. * @deprecated Use {@link Definition#inherit(Definition)}. */ protected void overload(Definition parent, Definition child) { child.inherit(parent); }
/** * Overloads a child definition with a given parent. * All attributes present in child are kept. All missing attributes are * copied from the parent. * Special attribute 'template','role' and 'extends' are overloaded in child * if not defined * * @param parent The parent definition. * @param child The child that will be overloaded. * @deprecated Use {@link Definition#inherit(org.apache.tiles.AttributeContext)}. */ @Deprecated protected void overload(Definition parent, Definition child) { child.inherit(parent); } }
/** {@inheritDoc} */ @Override protected Definition getDefinitionFromResolver(String name, Locale customizationKey) { Definition retValue = super.getDefinitionFromResolver(name, customizationKey); if (retValue != null && retValue.getExtends() != null) { Definition parent = getDefinition(retValue.getExtends(), customizationKey); retValue.inherit(parent); } return retValue; }
alreadyResolvedDefinitions); definition.inherit(parent);
alreadyResolvedDefinitions); definition.inherit(parent);
definition.inherit(parent);
definition.inherit(parent);
/** {@inheritDoc} */ public Definition getDefinition(String name, TilesRequestContext tilesContext) { Definition retValue; Locale locale = null; if (tilesContext != null) { locale = localeResolver.resolveLocale(tilesContext); } retValue = definitionDao.getDefinition(name, locale); if (retValue != null) { retValue = new Definition(retValue); String parentDefinitionName = retValue.getExtends(); while (parentDefinitionName != null) { Definition parent = definitionDao.getDefinition( parentDefinitionName, locale); if (parent == null) { throw new NoSuchDefinitionException("Cannot find definition '" + parentDefinitionName + "' ancestor of '" + retValue.getName() + "'"); } retValue.inherit(parent); parentDefinitionName = parent.getExtends(); } } return retValue; }
resolveInheritance(parent, request); definition.inherit(parent);
+ retValue.getName() + "'"); retValue.inherit(parent); parentDefinitionName = parent.getExtends();