public class ResourceNameIterator extends Object implements IResourceNameIterator
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:
Locales may contain a language, a country and a region or variant. Combinations of these components will be attempted in the following order:
| Constructor and Description |
|---|
ResourceNameIterator(String path,
String style,
String variation,
Locale locale,
Iterable<String> extensions,
boolean strict)
Construct.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getExtension()
Get the exact filename extension used for the latest resource path.
|
Locale |
getLocale()
Get the exact Locale which has been used for the latest resource path.
|
String |
getStyle()
Get the exact Style which has been used for the latest resource path.
|
String |
getVariation()
Get the exact Variation which has been used for the latest resource path.
|
boolean |
hasNext() |
protected ExtensionResourceNameIterator |
newExtensionResourceNameIterator(Iterable<String> extensions) |
protected LocaleResourceNameIterator |
newLocaleResourceNameIterator(Locale locale,
boolean strict) |
protected StyleAndVariationResourceNameIterator |
newStyleAndVariationResourceNameIterator(String style,
String variation) |
String |
next() |
void |
remove() |
String |
toString() |
public ResourceNameIterator(String path, String style, String variation, Locale locale, Iterable<String> extensions, boolean strict)
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 applyextensions - the filename's extensionsstrict - If false, weaker combinations of style, locale, etc. are tested as wellpublic final Locale getLocale()
getLocale in interface IResourceNameIteratorpublic final String getStyle()
getStyle in interface IResourceNameIteratorpublic final String getVariation()
getVariation in interface IResourceNameIteratorpublic final String getExtension()
getExtension in interface IResourceNameIteratorpublic boolean hasNext()
hasNext in interface Iterator<String>Iterator.hasNext()public String next()
next in interface Iterator<String>Iterator.next()public String toString()
toString in class ObjectObject.toString()protected LocaleResourceNameIterator newLocaleResourceNameIterator(Locale locale, boolean strict)
locale - strict - protected StyleAndVariationResourceNameIterator newStyleAndVariationResourceNameIterator(String style, String variation)
style - variation - protected ExtensionResourceNameIterator newExtensionResourceNameIterator(Iterable<String> extensions)
extensions - public void remove()
remove in interface Iterator<String>Iterator.remove()Copyright © 2006–2021 Apache Software Foundation. All rights reserved.