org.apache.tiles.core.definition.pattern

## Class AbstractPatternDefinitionResolver<T>

- java.lang.Object
- - org.apache.tiles.core.definition.pattern.AbstractPatternDefinitionResolver<T>

- Type Parameters:
    `T` - The type of the customization key.
  All Implemented Interfaces:
    PatternDefinitionResolver<T>
  Direct Known Subclasses:
    BasicPatternDefinitionResolver, PrefixedPatternDefinitionResolver

      public abstract class AbstractPatternDefinitionResolver<T>
      extends Object
      implements PatternDefinitionResolver<T>

  A pattern definition resolver that stores `DefinitionPatternMatcher` separated by customization key.
  Implementations should provide a way to translate a definition to a `DefinitionPatternMatcher`.
  Since:
    2.2.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractPatternDefinitionResolver()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract Map<String,Definition>` | `addDefinitionsAsPatternMatchers(List<DefinitionPatternMatcher> matchers, Map<String,Definition> defsMap)` Adds definitions, filtering and adding them to the list of definition pattern matchers.
    `void` | `clearPatternPaths(T customizationKey)` Used to clear all entries in the localePatternPaths for a specific locale.
    `Definition` | `resolveDefinition(String name, T customizationKey)` Resolves a definition searching in all patterns for the requested customization key.
    `Map<String,Definition>` | `storeDefinitionPatterns(Map<String,Definition> localeDefsMap, T customizationKey)` Stores definition patterns.

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

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

- - ### Constructor Detail

    - #### AbstractPatternDefinitionResolver

          public AbstractPatternDefinitionResolver()

  - ### Method Detail

    - #### resolveDefinition

          public Definition resolveDefinition(String name,
                                              T customizationKey)

      Resolves a definition searching in all patterns for the requested customization key.
      Specified by:
        `resolveDefinition` in interface `PatternDefinitionResolver<T>`
      Parameters:
        `name` - The name of the definition.
        `customizationKey` - The customization key.
      Returns:
        The resolved definition.

    - #### storeDefinitionPatterns

          public Map<String,Definition> storeDefinitionPatterns(Map<String,Definition> localeDefsMap,
                                                                T customizationKey)

      Stores definition patterns.
      Specified by:
        `storeDefinitionPatterns` in interface `PatternDefinitionResolver<T>`
      Parameters:
        `localeDefsMap` - The map of definitions that may contain also patterns.
        `customizationKey` - The customization key.
      Returns:
        The map of the definitions not recognized as containing definition patterns.

    - #### addDefinitionsAsPatternMatchers

          protected abstract Map<String,Definition> addDefinitionsAsPatternMatchers(List<DefinitionPatternMatcher> matchers,
                                                                                    Map<String,Definition> defsMap)

      Adds definitions, filtering and adding them to the list of definition pattern matchers. Only a subset of definitions will be transformed into definition pattern matchers.
      Parameters:
        `matchers` - The list containing the currently stored definition pattern matchers.
        `defsMap` - The definition map to parse.
      Returns:
        The map of the definitions not recognized as containing definition patterns.
      Since:
        2.2.1

    - #### clearPatternPaths

          public void clearPatternPaths(T customizationKey)

      Used to clear all entries in the localePatternPaths for a specific locale. Necessary when reloading definition files to ensure that the list is cleared first
      Specified by:
        `clearPatternPaths` in interface `PatternDefinitionResolver<T>`
      Parameters:
        `customizationKey` - customization key

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