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

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

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

Definition.getName介绍

[英]Access method for the name property.
[中]name属性的访问方法。

代码示例

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

/**
 * Adds a new <code>Definition</code> to the internal Map or replaces
 * an existing one.
 *
 * @param definition The Definition object to be added.
 */
public void addDefinition(Definition definition) {
  String name = definition.getName();
  if (name == null) {
    throw new DigesterDefinitionsReaderException(
        "A root definition has been defined with no name");
  }
  definitions.put(name, definition);
}

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

/**
 * Adds a new <code>Definition</code> to the internal Map or replaces
 * an existing one.
 *
 * @param definition The Definition object to be added.
 */
public void addDefinition(Definition definition) {
  String name = definition.getName();
  if (name == null) {
    throw new DigesterDefinitionsReaderException(
        "A root definition has been defined with no name");
  }
  definitions.put(name, definition);
}

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

/**
 * Find parent tag which must implement {@link DefinitionTagParent}.
 * @throws TilesJspException If we can't find an appropriate enclosing tag.
 * @since 2.1.0
 */
protected void callParent() throws TilesJspException {
  // Get enclosing parent
  DefinitionTagParent enclosingParent =
      findEnclosingDefinitionTagParent();
  if (enclosingParent != null) {
    enclosingParent.processNestedDefinitionName(definition.getName());
  }
}

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

/** {@inheritDoc} */
@Override
public void register(Definition definition, Request request) {
  Map<String, Definition> definitions = getOrCreateDefinitions(request);
  if (definition.getName() == null) {
    definition.setName(getNextUniqueDefinitionName(definitions));
  }
  if (definition.isExtending()) {
    this.resolveInheritance(definition, request);
  }
  definitions.put(definition.getName(), definition);
}

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

/** {@inheritDoc} */
  @Override
  public void begin(String namespace, String name, Attributes attributes) {
    Definition definition = (Definition) digester.peek(0);
    if (definition.getName() == null) {
      definition.setName(getNextUniqueDefinitionName(definitions));
    }
    Attribute attribute = (Attribute) digester.peek(1);
    attribute.setValue(definition.getName());
    attribute.setRenderer("definition");
  }
}

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

|| alreadyResolvedDefinitions.contains(definition.getName())) {
  return;
    definition.getName(), definition.getExtends());
alreadyResolvedDefinitions.add(definition.getName());
if (parent == null) { // error
  String msg = "Error while resolving definition inheritance: child '"
    + definition.getName()
    + "' can't find its ancestor '"
    + definition.getExtends()

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

|| alreadyResolvedDefinitions.contains(definition.getName())) {
  return;
    + definition.getName()
    + "' extends='" + definition.getExtends() + "'.");
alreadyResolvedDefinitions.add(definition.getName());
if (parent == null) { // error
  String msg = "Error while resolving definition inheritance: child '"
    + definition.getName()
    + "' can't find its ancestor '"
    + definition.getExtends()

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

/** {@inheritDoc} */
  @Override
  public void begin(String namespace, String name, Attributes attributes)
      throws Exception {
    Definition definition = (Definition) digester.peek(0);
    if (definition.getName() == null) {
      definition.setName(getNextUniqueDefinitionName(definitions));
    }
    Attribute attribute = (Attribute) digester.peek(1);
    attribute.setValue(definition.getName());
    attribute.setRenderer("definition");
  }
}

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

|| alreadyResolvedDefinitions.contains(definition.getName())) {
  return;
    + definition.getName()
    + "' extends='" + definition.getExtends() + "'.");
alreadyResolvedDefinitions.add(definition.getName());
if (parent == null) { // error
  String msg = "Error while resolving definition inheritance: child '"
    + definition.getName()
    + "' can't find its ancestor '"
    + definition.getExtends()

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

/**
 * Adds a definition to the set of custom ones.
 *
 * @param definition The definition to add.
 * @param request The current request.
 * @throws org.apache.tiles.definition.DefinitionsFactoryException If
 * something goes wrong during the addition.
 */
public void addDefinition(Definition definition,
    TilesRequestContext request) {
  Map<String, Definition> definitions = getOrCreateDefinitions(request);
  if (definition.getName() == null) {
    definition.setName(getNextUniqueDefinitionName(definitions));
  }
  validate(definition);
  if (definition.isExtending()) {
    this.resolveInheritance(definition, request);
  }
  definitions.put(definition.getName(), definition);
}

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

/**
   * Registers a definition in the container.
   *
   * @param definition The definition to register.
   * @param container The container into which the definition will be
   * registered.
   * @param composeStack The compose stack,
   * @param request The request.
   */
  private void registerDefinition(Definition definition,
      MutableTilesContainer container, Deque<Object> composeStack,
      Request request) {
    container.register(definition, request);

    if (composeStack.isEmpty()) {
      return;
    }

    Object obj = composeStack.peek();
    if (obj instanceof Attribute) {
      Attribute attribute = (Attribute) obj;
      attribute.setValue(definition.getName());
      if (attribute.getRenderer() == null) {
        attribute.setRenderer("definition");
      }
    }
  }
}

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

+ definition.getName()
+ "' extends='" + definition.getExtends() + "'.");
+ definition.getName()
+ "' can't find its ancestor '"
+ definition.getExtends()

代码示例来源:origin: org.apache.struts/struts2-tiles-plugin

Definition definition = annotationProcessor.buildTilesDefinition(location, tilesDefinition);
if (container instanceof MutableTilesContainer) {
  LOG.debug("registering tiles definition with name '{}'", definition.getName());
  ((MutableTilesContainer)container).register(definition, request);
} else {

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

/** {@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;
}

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

throw new NoSuchDefinitionException(
    "Error while resolving definition inheritance: child '"
        + definition.getName()
        + "' can't find its ancestor '"
        + parentDefinitionName

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

throw new NoSuchDefinitionException("Cannot find definition '"
    + parentDefinitionName + "' ancestor of '"
    + retValue.getName() + "'");

相关文章