org.apache.tapestry5.ioc.internal.util
Class LocalizedNameGenerator

java.lang.Object
  extended by org.apache.tapestry5.ioc.internal.util.LocalizedNameGenerator
All Implemented Interfaces:
Iterable<String>, Iterator<String>

public class LocalizedNameGenerator
extends Object
implements Iterator<String>, Iterable<String>

Used in a wide variety of resource searches. Generates a series of name variations from a path (which must include a suffix) and locale.

This class is not threadsafe.


Constructor Summary
LocalizedNameGenerator(String path, Locale 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

LocalizedNameGenerator

public LocalizedNameGenerator(String path,
                              Locale locale)
Method Detail

hasNext

public boolean hasNext()
Returns true if there are more name variants to be returned, false otherwise.

Specified by:
hasNext in interface Iterator<String>

next

public String next()
Returns the next localized variant.

Specified by:
next in interface Iterator<String>
Throws:
NoSuchElementException - if all variants have been returned.

getCurrentLocale

public Locale getCurrentLocale()

remove

public void remove()
Specified by:
remove in interface Iterator<String>
Throws:
UnsupportedOperationException

iterator

public Iterator<String> iterator()
So that LNG may be used with the for loop.

Specified by:
iterator in interface Iterable<String>


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.