Package 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
  Description
  `BasicAttributeEvaluatorFactory(AttributeEvaluator defaultEvaluator)`
  Constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `AttributeEvaluator`
  `getAttributeEvaluator(String language)`
  Creates and attribute evaluator for the given expression language.
  `AttributeEvaluator`
  `getAttributeEvaluator(Attribute attribute)`
  Creates and attribute evaluator using an attribute.
  `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 Details

  - ### 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 Details

  - ### 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`.