com.dteoh.treasuremap
Class ResourceMaps

java.lang.Object
  extended by com.dteoh.treasuremap.ResourceMaps

public final class ResourceMaps
extends java.lang.Object

Builder for creating ResourceMaps.

Author:
Douglas Teoh

Constructor Summary
ResourceMaps(java.lang.Class<?> c)
          Creates a new resource map builder.
ResourceMaps(java.lang.Class<?> c, java.util.Locale locale)
          Creates a new resource map builder with the given locale.
 
Method Summary
 ResourceMaps and(java.lang.Class<?> c)
          Adds the given class's resource bundle as part of the resource map to build.
 ResourceMap build()
          Creates a ResourceMap using the currently configured builder.
 ResourceMaps withParent(ResourceMap parentMap)
          Uses the given resource map as a parent resource map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceMaps

public ResourceMaps(java.lang.Class<?> c)
Creates a new resource map builder. Uses the default locale of the JVM.

Parameters:
c - The class to create the resource map for.

ResourceMaps

public ResourceMaps(java.lang.Class<?> c,
                    java.util.Locale locale)
Creates a new resource map builder with the given locale.

Parameters:
c - The class to create the resource map for.
locale - The locale to use when creating resource maps.
Method Detail

withParent

public ResourceMaps withParent(ResourceMap parentMap)
Uses the given resource map as a parent resource map. The builder will only use the last configured parent resource map as the parent resource map of the resource map to build. The configured locale will not affect the parent resource map.

Parameters:
parentMap - Resource map to use as a parent resource map.
Returns:
this

and

public ResourceMaps and(java.lang.Class<?> c)
Adds the given class's resource bundle as part of the resource map to build. Uses the builder's configured locale.

Parameters:
c - The class to add to the resource map to be built.
Returns:
this

build

public ResourceMap build()
Creates a ResourceMap using the currently configured builder.

Returns:
The newly created ResourceMap.


Copyright © 2010. All Rights Reserved.