org.apache.tiles.Definition.inherit()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中org.apache.tiles.Definition.inherit()方法的一些代码示例,展示了Definition.inherit()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Definition.inherit()方法的具体详情如下:
包路径:org.apache.tiles.Definition
类名称:Definition
方法名:inherit

Definition.inherit介绍

[英]Extends attribute value.
[中]

代码示例

代码示例来源:origin: org.apache.tiles/com.springsource.org.apache.tiles.core

  1. /**
  2. * Overloads a child definition with a given parent.
  3. * All attributes present in child are kept. All missing attributes are
  4. * copied from the parent.
  5. * Special attribute 'template','role' and 'extends' are overloaded in child
  6. * if not defined
  7. *
  8. * @param parent The parent definition.
  9. * @param child The child that will be overloaded.
  10. * @deprecated Use {@link Definition#inherit(Definition)}.
  11. */
  12. protected void overload(Definition parent, Definition child) {
  13. child.inherit(parent);
  14. }

代码示例来源:origin: org.apache.tiles/com.springsource.org.apache.tiles.core

  1. /**
  2. * Overloads a child definition with a given parent.
  3. * All attributes present in child are kept. All missing attributes are
  4. * copied from the parent.
  5. * Special attribute 'template','role' and 'extends' are overloaded in child
  6. * if not defined
  7. *
  8. * @param parent The parent definition.
  9. * @param child The child that will be overloaded.
  10. * @deprecated Use {@link Definition#inherit(org.apache.tiles.AttributeContext)}.
  11. */
  12. @Deprecated
  13. protected void overload(Definition parent, Definition child) {
  14. child.inherit(parent);
  15. }
  16. }

代码示例来源:origin: org.apache.tiles/tiles-core

  1. /** {@inheritDoc} */
  2. @Override
  3. protected Definition getDefinitionFromResolver(String name,
  4. Locale customizationKey) {
  5. Definition retValue = super.getDefinitionFromResolver(name, customizationKey);
  6. if (retValue != null && retValue.getExtends() != null) {
  7. Definition parent = getDefinition(retValue.getExtends(), customizationKey);
  8. retValue.inherit(parent);
  9. }
  10. return retValue;
  11. }

代码示例来源:origin: org.apache.tiles/com.springsource.org.apache.tiles.core

  1. alreadyResolvedDefinitions);
  2. definition.inherit(parent);

代码示例来源:origin: org.apache.tiles/tiles-core

  1. alreadyResolvedDefinitions);
  2. definition.inherit(parent);

代码示例来源:origin: org.apache.tiles/com.springsource.org.apache.tiles.core

  1. definition.inherit(parent);

代码示例来源:origin: org.apache.tiles/com.springsource.org.apache.tiles.core

  1. definition.inherit(parent);

代码示例来源:origin: org.apache.tiles/com.springsource.org.apache.tiles.core

  1. /** {@inheritDoc} */
  2. public Definition getDefinition(String name,
  3. TilesRequestContext tilesContext) {
  4. Definition retValue;
  5. Locale locale = null;
  6. if (tilesContext != null) {
  7. locale = localeResolver.resolveLocale(tilesContext);
  8. }
  9. retValue = definitionDao.getDefinition(name, locale);
  10. if (retValue != null) {
  11. retValue = new Definition(retValue);
  12. String parentDefinitionName = retValue.getExtends();
  13. while (parentDefinitionName != null) {
  14. Definition parent = definitionDao.getDefinition(
  15. parentDefinitionName, locale);
  16. if (parent == null) {
  17. throw new NoSuchDefinitionException("Cannot find definition '"
  18. + parentDefinitionName + "' ancestor of '"
  19. + retValue.getName() + "'");
  20. }
  21. retValue.inherit(parent);
  22. parentDefinitionName = parent.getExtends();
  23. }
  24. }
  25. return retValue;
  26. }

代码示例来源:origin: org.apache.tiles/tiles-core

  1. resolveInheritance(parent, request);
  2. definition.inherit(parent);

代码示例来源:origin: org.apache.tiles/tiles-core

  1. + retValue.getName() + "'");
  2. retValue.inherit(parent);
  3. parentDefinitionName = parent.getExtends();

相关文章