Class ResourceNameIterator

  • All Implemented Interfaces:
    Iterator<String>, IResourceNameIterator
    Direct Known Subclasses:
    EmptyResourceNameIterator

    public class ResourceNameIterator
    extends Object
    implements IResourceNameIterator
    Contains the logic to locate a resource based on a path, style (see Session), variation, locale and extension strings. The full filename will be built like: <path>_<variation>_<_<style>_<locale>.<extension>.

    Resource matches will be attempted in the following order:

    1. 1. <path>_<style>_<locale>.<extension>
    2. 2. <path>_<locale>.<extension>
    3. 3. <path>_<style>.<extension>
    4. 4. <path>.<extension>

    Locales may contain a language, a country and a region or variant. Combinations of these components will be attempted in the following order:

    1. locale.toString() see javadoc for Locale for more details
    2. <language>_<country>
    3. <language>
    Author:
    Juergen Donnerstag
    • Constructor Detail

      • ResourceNameIterator

        public ResourceNameIterator​(String path,
                                    String style,
                                    String variation,
                                    Locale locale,
                                    Iterable<String> extensions,
                                    boolean strict)
        Construct.
        Parameters:
        path - The path of the resource. In case the parameter 'extensions' is null, the path will be checked and if a filename extension is present, it'll be used instead.
        style - A theme or style (see Session)
        variation - The component's variation (of the style)
        locale - The Locale to apply
        extensions - the filename's extensions
        strict - If false, weaker combinations of style, locale, etc. are tested as well