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

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

public class LocalizedNameGenerator
extends java.lang.Object
implements java.util.Iterator<java.lang.String>, java.lang.Iterable<java.lang.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(java.lang.String path, java.util.Locale 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

LocalizedNameGenerator

public LocalizedNameGenerator(java.lang.String path,
                              java.util.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 java.util.Iterator<java.lang.String>

next

public java.lang.String next()
Returns the next localized variant.

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

getCurrentLocale

public java.util.Locale getCurrentLocale()

remove

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

iterator

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

Specified by:
iterator in interface java.lang.Iterable<java.lang.String>


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