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

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

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

Definition.<init>介绍

[英]Constructor.
[中]构造器。

代码示例

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

  1. /**
  2. * Copies the definition map to be passed to a higher level of customization
  3. * key.
  4. *
  5. * @param localeDefsMap The map of definition to be copied.
  6. * @return The copy of the definition map. This particular implementation
  7. * deep-copies the <code>localeDefsMap</code> into a {@link LinkedHashMap}.
  8. * @since 2.1.4
  9. */
  10. @Override
  11. protected Map<String, Definition> copyDefinitionMap(
  12. Map<String, Definition> localeDefsMap) {
  13. Map<String, Definition> retValue = new LinkedHashMap<String, Definition>(
  14. localeDefsMap.size());
  15. for (Map.Entry<String, Definition> entry : localeDefsMap.entrySet()) {
  16. Definition definition = new Definition(entry.getValue());
  17. retValue.put(entry.getKey(), definition);
  18. }
  19. return retValue;
  20. }
  21. }

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

  1. /**
  2. * Copies the definition map to be passed to a higher level of customization
  3. * key.
  4. *
  5. * @param localeDefsMap The map of definition to be copied.
  6. * @return The copy of the definition map. This particular implementation
  7. * deep-copies the <code>localeDefsMap</code> into a {@link LinkedHashMap}.
  8. * @since 2.1.4
  9. */
  10. @Override
  11. protected Map<String, Definition> copyDefinitionMap(
  12. Map<String, Definition> localeDefsMap) {
  13. Map<String, Definition> retValue = new LinkedHashMap<String, Definition>(
  14. localeDefsMap.size());
  15. for (Map.Entry<String, Definition> entry : localeDefsMap.entrySet()) {
  16. Definition definition = new Definition(entry.getValue());
  17. retValue.put(entry.getKey(), definition);
  18. }
  19. return retValue;
  20. }
  21. }

代码示例来源:origin: stackoverflow.com

  1. Definition d = new Definition();
  2. d.setCategory(GrammaticalCategory.ADJECTIVE);
  3. d.setDefinition("testdefinition");
  4. JAXB.marshal(d, new File("out.xml"));

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

  1. /** {@inheritDoc} */
  2. @Override
  3. protected Map<String, Definition> addDefinitionsAsPatternMatchers(
  4. List<DefinitionPatternMatcher> matchers,
  5. Map<String, Definition> defsMap) {
  6. Set<String> excludedKeys = new LinkedHashSet<String>();
  7. for (Map.Entry<String, Definition> entry : defsMap.entrySet()) {
  8. String key = entry.getKey();
  9. Expression expression = Expression
  10. .createExpressionFromDescribedExpression(key);
  11. if (expression.getLanguage() != null) {
  12. DefinitionPatternMatcherFactory factory = language2matcherFactory
  13. .get(expression.getLanguage());
  14. if (factory != null) {
  15. DefinitionPatternMatcher matcher = factory
  16. .createDefinitionPatternMatcher(expression
  17. .getExpression(), new Definition(entry
  18. .getValue()));
  19. matchers.add(matcher);
  20. } else {
  21. logger.warn("Cannot find a DefinitionPatternMatcherFactory for expression '{}'",
  22. key);
  23. }
  24. } else {
  25. excludedKeys.add(key);
  26. }
  27. }
  28. return PatternUtil.createExtractedMap(defsMap, excludedKeys);
  29. }
  30. }

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

  1. /**
  2. * Creates the definition to store.
  3. *
  4. * @param name The name of the definition to create. If not specified, an
  5. * anonymous definition will be created.
  6. * @param template The template of this definition.
  7. * @param role A comma-separated list of roles. If present, the definition
  8. * will be rendered only if the current user belongs to one of the roles.
  9. * @param extendsParam The definition name that this definition extends.
  10. * @param preparer The preparer to use to invoke before the definition is
  11. * rendered.
  12. * @return The created definition.
  13. */
  14. private Definition createDefinition(String name, String template,
  15. String role, String extendsParam, String preparer) {
  16. Definition definition = new Definition();
  17. definition.setName(name);
  18. Attribute templateAttribute = Attribute
  19. .createTemplateAttribute(template);
  20. templateAttribute.setRole(role);
  21. definition.setTemplateAttribute(templateAttribute);
  22. definition.setExtends(extendsParam);
  23. definition.setPreparer(preparer);
  24. return definition;
  25. }

代码示例来源: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. retValue = new Definition(retValue);
  2. String parentDefinitionName = retValue.getExtends();
  3. while (parentDefinitionName != null) {

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

  1. /** {@inheritDoc} */
  2. public int doStartTag() throws TilesJspException {
  3. definition = new Definition();
  4. definition.setName(name);
  5. Attribute templateAttribute = Attribute
  6. .createTemplateAttribute(template);
  7. templateAttribute.setRole(role);
  8. definition.setTemplateAttribute(templateAttribute);
  9. definition.setExtends(extend);
  10. definition.setPreparer(preparer);
  11. TilesContainer c = JspUtil.getCurrentContainer(pageContext);
  12. if (c == null) {
  13. throw new TilesJspException("TilesContainer not initialized");
  14. }
  15. if (!(c instanceof MutableTilesContainer)) {
  16. throw new TilesJspException(
  17. "Unable to define definition for a "
  18. + "container which does not implement MutableTilesContainer");
  19. }
  20. container = (MutableTilesContainer) c;
  21. return EVAL_BODY_INCLUDE;
  22. }

代码示例来源: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. }

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

  1. Definition nudef = new Definition();

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

  1. Definition definition = new Definition();

相关文章