|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry5.ioc.util.LocalizedNameGenerator
public class LocalizedNameGenerator
Generates name variations for a given file name or path and a locale. The name variations are provided in most-specific to least-specific order, so for a path of "Base.ext" and a Locale of "en_US", the generated names would be "Base_en_US.ext", "Base_en.ext", "Base.ext".
Implements Iterable, so a LocalizedNameGenerator may be used directly in a for loop.
This class is not threadsafe.
| Constructor Summary | |
|---|---|
LocalizedNameGenerator(String path,
Locale locale)
Creates a new generator for the given path and locale. |
|
| Method Summary | |
|---|---|
Locale |
getCurrentLocale()
|
boolean |
hasNext()
Returns true if there are more name variants to be returned, false otherwise. |
Iterator<String> |
iterator()
So that LNG may be used with the for loop. |
String |
next()
Returns the next localized variant. |
void |
remove()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LocalizedNameGenerator(String path,
Locale locale)
path - non-blank pathlocale - non-null locale| Method Detail |
|---|
public boolean hasNext()
hasNext in interface Iterator<String>public String next()
next in interface Iterator<String>NoSuchElementException - if all variants have been returned.public Locale getCurrentLocale()
public void remove()
remove in interface Iterator<String>UnsupportedOperationExceptionpublic Iterator<String> iterator()
iterator in interface Iterable<String>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||