org.apache.tiles.core.evaluator

## Class BasicAttributeEvaluatorFactory

- java.lang.Object
- - org.apache.tiles.core.evaluator.BasicAttributeEvaluatorFactory

- All Implemented Interfaces:
    AttributeEvaluatorFactory

      public class BasicAttributeEvaluatorFactory
      extends Object
      implements AttributeEvaluatorFactory

  Basic implementation of `AttributeEvaluatorFactory`. It supports a default attribute evaluator, in case the language is not recognized.
  Since:
    2.2.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicAttributeEvaluatorFactory(AttributeEvaluator defaultEvaluator)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AttributeEvaluator` | `getAttributeEvaluator(Attribute attribute)` Creates and attribute evaluator using an attribute.
    `AttributeEvaluator` | `getAttributeEvaluator(String language)` Creates and attribute evaluator for the given expression language.
    `void` | `registerAttributeEvaluator(String language, AttributeEvaluator evaluator)` Registers a known expression language with its attribute evaluator.

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

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

- - ### Constructor Detail

    - #### BasicAttributeEvaluatorFactory

          public BasicAttributeEvaluatorFactory(AttributeEvaluator defaultEvaluator)

      Constructor.
      Parameters:
        `defaultEvaluator` - The default evaluator to return if it is not found in the map of known languages.
      Since:
        2.2.0

  - ### Method Detail

    - #### registerAttributeEvaluator

          public void registerAttributeEvaluator(String language,
                                                 AttributeEvaluator evaluator)

      Registers a known expression language with its attribute evaluator.
      Parameters:
        `language` - The name of the expression language.
        `evaluator` - The associated attribute evaluator.
      Since:
        2.2.0

    - #### getAttributeEvaluator

          public AttributeEvaluator getAttributeEvaluator(String language)

      Creates and attribute evaluator for the given expression language.
      Specified by:
        `getAttributeEvaluator` in interface `AttributeEvaluatorFactory`
      Parameters:
        `language` - The name of the expression language.
      Returns:
        The attribute evaluator. It must not be `null`.

    - #### getAttributeEvaluator

          public AttributeEvaluator getAttributeEvaluator(Attribute attribute)

      Creates and attribute evaluator using an attribute.
      Specified by:
        `getAttributeEvaluator` in interface `AttributeEvaluatorFactory`
      Parameters:
        `attribute` - The attribute used to obtain the evaluator.
      Returns:
        The attribute evaluator. It must not be `null`.

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