|
||||||||||
| 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(java.lang.String path,
java.util.Locale locale)
Creates a new generator for the given path and locale. |
|
| Method Summary | |
|---|---|
java.util.Locale |
getCurrentLocale()
|
boolean |
hasNext()
Returns true if there are more name variants to be returned, false otherwise. |
java.util.Iterator<java.lang.String> |
iterator()
So that LNG may be used with the for loop. |
java.lang.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(java.lang.String path,
java.util.Locale locale)
path - non-blank pathlocale - non-null locale| Method Detail |
|---|
public boolean hasNext()
hasNext in interface java.util.Iterator<java.lang.String>public java.lang.String next()
next in interface java.util.Iterator<java.lang.String>java.util.NoSuchElementException - if all variants have been returned.public java.util.Locale getCurrentLocale()
public void remove()
remove in interface java.util.Iterator<java.lang.String>java.lang.UnsupportedOperationExceptionpublic java.util.Iterator<java.lang.String> iterator()
iterator in interface java.lang.Iterable<java.lang.String>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||