org.apache.struts2.tiles

## Class StrutsTilesContainerFactory

- java.lang.Object
- - org.apache.tiles.core.factory.AbstractTilesContainerFactory
  - - org.apache.tiles.core.factory.BasicTilesContainerFactory
    - - org.apache.struts2.tiles.StrutsTilesContainerFactory

-     public class StrutsTilesContainerFactory
      extends BasicTilesContainerFactory

  Dedicated Struts factory to build Tiles container with support for: - Freemarker - I18N using Struts resource bundles - S2 ro access Struts' ValueStack - OGNL - EL

  If you need additional features create your own listener and factory, you can base on code from Tiles' CompleteAutoloadTilesContainerFactory

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `EL`
    `static String` | `FREEMARKER_RENDERER_NAME` The freemarker renderer name.
    `static String` | `I18N`
    `static String` | `OGNL` Supported expression languages
    `static String` | `PATTERN_REGEXP`
    `static String` | `PATTERN_WILDCARD` Supported pattern types
    `static String` | `S2`
    `static String` | `TILES_DEFAULT_PATTERN` Deprecated. since Struts 6.4.0, use `TILES_DEFAULT_PATTERNS` instead
    `static Set<String>` | `TILES_DEFAULT_PATTERNS` Default pattern to be used to collect Tiles definitions if user didn't configure any

    - ### Fields inherited from class org.apache.tiles.core.factory.BasicTilesContainerFactory

      `DEFINITION_RENDERER_NAME, STRING_RENDERER_NAME, TEMPLATE_RENDERER_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StrutsTilesContainerFactory()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected AttributeEvaluatorFactory` | `createAttributeEvaluatorFactory(ApplicationContext applicationContext, LocaleResolver resolver)` Creates the attribute evaluator factory to use.
    `TilesContainer` | `createDecoratedContainer(TilesContainer originalContainer, ApplicationContext applicationContext)` Instantiate the container that will be injected to child objects.
    `protected Renderer` | `createDefaultAttributeRenderer(BasicRendererFactory rendererFactory, ApplicationContext applicationContext, TilesContainer container, AttributeEvaluatorFactory attributeEvaluatorFactory)` Creates the default attribute renderer.
    `protected ELAttributeEvaluator` | `createELEvaluator(ApplicationContext applicationContext)`
    `protected I18NAttributeEvaluator` | `createI18NEvaluator()`
    `protected LocaleResolver` | `createLocaleResolver(ApplicationContext applicationContext)` Creates the locale resolver.
    `protected OGNLAttributeEvaluator` | `createOGNLEvaluator()`
    `protected <T> PatternDefinitionResolver<T>` | `createPatternDefinitionResolver(Class<T> customizationKeyClass)` Creates a new pattern definition resolver.
    `protected PreparerFactory` | `createPreparerFactory(ApplicationContext applicationContext)` Creates the preparer factory to use.
    `protected StrutsAttributeEvaluator` | `createStrutsEvaluator()`
    `protected List<ApplicationResource>` | `getSources(ApplicationContext applicationContext)` Returns a list containing the resources to be parsed.
    `protected Set<String>` | `getTilesDefinitions(Map<String,String> params)`
    `protected void` | `registerAttributeRenderers(BasicRendererFactory rendererFactory, ApplicationContext applicationContext, TilesContainer container, AttributeEvaluatorFactory attributeEvaluatorFactory)` Registers attribute renderers in a `BasicRendererFactory`.

    - ### Methods inherited from class org.apache.tiles.core.factory.BasicTilesContainerFactory

      `createContainer, createDefinitionAttributeRenderer, createDefinitionsFactory, createDefinitionsReader, createLocaleDefinitionDao, createRendererFactory, createStringAttributeRenderer, createTemplateAttributeRenderer, instantiateContainer, instantiateDefinitionsFactory, instantiateLocaleDefinitionDao`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### FREEMARKER_RENDERER_NAME

          public static final String FREEMARKER_RENDERER_NAME

      The freemarker renderer name.
      See Also:
        Constant Field Values

    - #### PATTERN_WILDCARD

          public static final String PATTERN_WILDCARD

      Supported pattern types
      See Also:
        Constant Field Values

    - #### PATTERN_REGEXP

          public static final String PATTERN_REGEXP

      See Also:
        Constant Field Values

    - #### TILES_DEFAULT_PATTERN

          @Deprecated
          public static final String TILES_DEFAULT_PATTERN

      Deprecated. since Struts 6.4.0, use `TILES_DEFAULT_PATTERNS` instead
      Default pattern to be used to collect Tiles definitions if user didn't configure any
      See Also:
        Constant Field Values

    - #### TILES_DEFAULT_PATTERNS

          public static final Set<String> TILES_DEFAULT_PATTERNS

      Default pattern to be used to collect Tiles definitions if user didn't configure any

    - #### OGNL

          public static final String OGNL

      Supported expression languages
      See Also:
        Constant Field Values

    - #### EL

          public static final String EL

      See Also:
        Constant Field Values

    - #### S2

          public static final String S2

      See Also:
        Constant Field Values

    - #### I18N

          public static final String I18N

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### StrutsTilesContainerFactory

          public StrutsTilesContainerFactory()

  - ### Method Detail

    - #### createDecoratedContainer

          public TilesContainer createDecoratedContainer(TilesContainer originalContainer,
                                                         ApplicationContext applicationContext)

      Description copied from class: `BasicTilesContainerFactory`
      Instantiate the container that will be injected to child objects.
      Overrides:
        `createDecoratedContainer` in class `BasicTilesContainerFactory`
      Parameters:
        `originalContainer` - The original instantiated container.
        `applicationContext` - The Tiles application context object.
      Returns:
        The instantiated container.

    - #### registerAttributeRenderers

          protected void registerAttributeRenderers(BasicRendererFactory rendererFactory,
                                                    ApplicationContext applicationContext,
                                                    TilesContainer container,
                                                    AttributeEvaluatorFactory attributeEvaluatorFactory)

      Description copied from class: `BasicTilesContainerFactory`
      Registers attribute renderers in a `BasicRendererFactory`. By default, it registers delegates to `StringRenderer`, `DispatchRenderer` and `DefinitionRenderer`.
      Overrides:
        `registerAttributeRenderers` in class `BasicTilesContainerFactory`
      Parameters:
        `rendererFactory` - The renderer factory to configure.
        `applicationContext` - The Tiles application context.
        `container` - The container.
        `attributeEvaluatorFactory` - The attribute evaluator factory.

    - #### createDefaultAttributeRenderer

          protected Renderer createDefaultAttributeRenderer(BasicRendererFactory rendererFactory,
                                                            ApplicationContext applicationContext,
                                                            TilesContainer container,
                                                            AttributeEvaluatorFactory attributeEvaluatorFactory)

      Description copied from class: `BasicTilesContainerFactory`
      Creates the default attribute renderer. By default it is an `ChainedDelegateRenderer`.
      Overrides:
        `createDefaultAttributeRenderer` in class `BasicTilesContainerFactory`
      Parameters:
        `rendererFactory` - The renderer factory to configure.
        `applicationContext` - The Tiles application context.
        `container` - The container.
        `attributeEvaluatorFactory` - The attribute evaluator factory.
      Returns:
        The default attribute renderer.

    - #### createAttributeEvaluatorFactory

          protected AttributeEvaluatorFactory createAttributeEvaluatorFactory(ApplicationContext applicationContext,
                                                                              LocaleResolver resolver)

      Description copied from class: `BasicTilesContainerFactory`
      Creates the attribute evaluator factory to use. By default it returns a `BasicAttributeEvaluatorFactory` containing the `DirectAttributeEvaluator` as the default evaluator.
      Overrides:
        `createAttributeEvaluatorFactory` in class `BasicTilesContainerFactory`
      Parameters:
        `applicationContext` - The Tiles application context.
        `resolver` - The locale resolver.
      Returns:
        The evaluator factory.

    - #### createPatternDefinitionResolver

          protected <T> PatternDefinitionResolver<T> createPatternDefinitionResolver(Class<T> customizationKeyClass)

      Description copied from class: `BasicTilesContainerFactory`
      Creates a new pattern definition resolver. By default, it instantiate a `BasicPatternDefinitionResolver` with `WildcardDefinitionPatternMatcherFactory` to manage wildcard substitution.
      Overrides:
        `createPatternDefinitionResolver` in class `BasicTilesContainerFactory`
      Type Parameters:
        `T` - The type of the customization key.
      Parameters:
        `customizationKeyClass` - The customization key class.
      Returns:
        The pattern definition resolver.

    - #### createLocaleResolver

          protected LocaleResolver createLocaleResolver(ApplicationContext applicationContext)

      Description copied from class: `BasicTilesContainerFactory`
      Creates the locale resolver. By default it creates a `DefaultLocaleResolver`.
      Overrides:
        `createLocaleResolver` in class `BasicTilesContainerFactory`
      Parameters:
        `applicationContext` - The Tiles application context.
      Returns:
        The locale resolver.

    - #### getSources

          protected List<ApplicationResource> getSources(ApplicationContext applicationContext)

      Description copied from class: `BasicTilesContainerFactory`
      Returns a list containing the resources to be parsed. By default, it returns a list containing the resource at "/WEB-INF/tiles.xml".
      Overrides:
        `getSources` in class `BasicTilesContainerFactory`
      Parameters:
        `applicationContext` - The Tiles application context.
      Returns:
        The resources.

    - #### createPreparerFactory

          protected PreparerFactory createPreparerFactory(ApplicationContext applicationContext)

      Description copied from class: `BasicTilesContainerFactory`
      Creates the preparer factory to use. By default it returns a `BasicPreparerFactory`.
      Overrides:
        `createPreparerFactory` in class `BasicTilesContainerFactory`
      Parameters:
        `applicationContext` - The Tiles application context.
      Returns:
        The preparer factory.

    - #### getTilesDefinitions

          protected Set<String> getTilesDefinitions(Map<String,String> params)

    - #### createELEvaluator

          protected ELAttributeEvaluator createELEvaluator(ApplicationContext applicationContext)

    - #### createStrutsEvaluator

          protected StrutsAttributeEvaluator createStrutsEvaluator()

    - #### createI18NEvaluator

          protected I18NAttributeEvaluator createI18NEvaluator()

    - #### createOGNLEvaluator

          protected OGNLAttributeEvaluator createOGNLEvaluator()

Copyright © 2000–2024 Apache Software Foundation. All rights reserved.