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

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

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

Definition.putAttribute介绍

暂无

代码示例

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

  1. /**
  2. * Add an attribute to this definition.
  3. * <p/>
  4. * This method is used by Digester to load definitions.
  5. *
  6. * @param attribute Attribute to add.
  7. * @deprecated Use {@link Definition#putAttribute(String, Attribute)}.
  8. */
  9. @Deprecated
  10. public void addAttribute(Attribute attribute) {
  11. putAttribute(attribute.getName(), attribute);
  12. }

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

  1. /**
  2. * Put an attribute in template definition.
  3. * Attribute can be used as content for tag get.
  4. *
  5. * @param name Attribute name
  6. * @param content Attribute value
  7. * @param role Determine if content is used by get tag. If user is in role, content is used.
  8. * @deprecated Use {@link AttributeContext#putAttribute(String, Attribute)}
  9. * or {@link AttributeContext#putAttribute(String, Attribute, boolean)}.
  10. */
  11. @Deprecated
  12. public void put(String name, Object content, String role) {
  13. Attribute attribute = new Attribute(content, null, role, (String) null);
  14. putAttribute(name, attribute);
  15. }

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

  1. /**
  2. * Put an attribute in template definition.
  3. * Attribute can be used as content for tag get.
  4. *
  5. * @param name Attribute name
  6. * @param content Attribute value
  7. * @param type attribute type: template, string, definition
  8. * @param role Determine if content is used by get tag. If user is in role, content is used.
  9. * @deprecated Use {@link AttributeContext#putAttribute(String, Attribute)}
  10. * or {@link AttributeContext#putAttribute(String, Attribute, boolean)}.
  11. */
  12. @Deprecated
  13. public void put(String name, Object content,
  14. org.apache.tiles.Attribute.AttributeType type, String role) {
  15. // Is there a type set ?
  16. // First check direct attribute, and translate it to a valueType.
  17. // Then, evaluate valueType, and create requested typed attribute.
  18. Attribute attribute = new Attribute(content, role, type);
  19. putAttribute(name, attribute);
  20. }

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

  1. /** {@inheritDoc} */
  2. @Override
  3. public void begin(String namespace, String name, Attributes attributes) {
  4. Attribute attribute = (Attribute) digester.peek(0);
  5. Definition definition = (Definition) digester.peek(1);
  6. definition.putAttribute(attributes.getValue("name"), attribute,
  7. "true".equals(attributes.getValue("cascade")));
  8. }
  9. }

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

  1. /** {@inheritDoc} */
  2. @Override
  3. public void begin(String namespace, String name, Attributes attributes)
  4. throws Exception {
  5. Attribute attribute = (Attribute) digester.peek(0);
  6. Definition definition = (Definition) digester.peek(1);
  7. definition.putAttribute(attributes.getValue("name"), attribute,
  8. "true".equals(attributes.getValue("cascade")));
  9. }
  10. }

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

  1. /** {@inheritDoc} */
  2. public Object mapRow(ResultSet rs, int row) throws SQLException {
  3. Attribute attribute = new Attribute();
  4. attribute.setRenderer(rs.getString("TYPE"));
  5. attribute.setValue(rs.getString("VALUE"));
  6. definition.putAttribute(rs.getString("NAME"), attribute, rs
  7. .getBoolean("CASCADE_ATTRIBUTE"));
  8. return attribute;
  9. }

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

  1. /**
  2. * Reset member values for reuse. This method calls super.release(),
  3. * which invokes TagSupport.release(), which typically does nothing.
  4. *
  5. * @param nestedTag The nested <code>PutAttributeTag</code>
  6. * @throws TilesJspException Never thrown, it's here for API compatibility.
  7. */
  8. public void processNestedTag(PutAttributeTag nestedTag) throws TilesJspException {
  9. Attribute attr = new Attribute(nestedTag.getValue(),
  10. null, nestedTag.getRole(), nestedTag.getType());
  11. definition.putAttribute(nestedTag.getName(), attr, nestedTag
  12. .isCascade());
  13. }

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

  1. /** {@inheritDoc} */
  2. public void processNestedTag(PutListAttributeTag nestedTag) {
  3. ListAttribute attribute = new ListAttribute(nestedTag.getAttributes());
  4. attribute.setRole(nestedTag.getRole());
  5. attribute.setInherit(nestedTag.getInherit());
  6. definition.putAttribute(nestedTag.getName(), attribute, nestedTag
  7. .isCascade());
  8. }

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

  1. Attribute nuattr = replaceVarsInAttribute(attr, vars);
  2. nudef.putAttribute(replace(attributeName, vars), nuattr);
  3. Attribute nuattr = replaceVarsInAttribute(attr, vars);
  4. nudef.putAttribute(replace(attributeName, vars), nuattr, true);

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

  1. definition.putAttribute(putAttribute.name(), attribute, putAttribute.cascade());
  2. definition.putAttribute(putListAttribute.name(), attribute, putListAttribute.cascade());

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

  1. /**
  2. * Creates a definition given its representation with wildcards.
  3. *
  4. * @param d The definition to replace.
  5. * @param name The name of the definition to be created.
  6. * @param vars The variables to be substituted.
  7. * @return The definition that can be rendered.
  8. * @since 2.1.0
  9. */
  10. protected Definition replaceDefinition(Definition d, String name,
  11. Map<Integer, String> vars) {
  12. Definition nudef = new Definition();
  13. nudef.setExtends(replace(d.getExtends(), vars));
  14. nudef.setName(name);
  15. nudef.setPreparer(replace(d.getPreparer(), vars));
  16. nudef.setTemplateAttribute(replaceVarsInAttribute(d
  17. .getTemplateAttribute(), vars));
  18. Set<String> localAttributeNames = d.getLocalAttributeNames();
  19. if (localAttributeNames != null && !localAttributeNames.isEmpty()) {
  20. for (String attributeName : localAttributeNames) {
  21. Attribute attr = d.getLocalAttribute(attributeName);
  22. Attribute nuattr = replaceVarsInAttribute(attr, vars);
  23. nudef.putAttribute(replace(attributeName, vars), nuattr);
  24. }
  25. }
  26. return nudef;
  27. }

相关文章