au.com.prunge.jgenfile.metadata
Class ResourceMetadataKey

java.lang.Object
  |
  +--au.com.prunge.jgenfile.metadata.AbstractMetadataKey
        |
        +--au.com.prunge.jgenfile.metadata.ResourceMetadataKey
All Implemented Interfaces:
MetadataKey

public class ResourceMetadataKey
extends AbstractMetadataKey

A key that uses resource bundles to get the key and description.

Version:
1.0
Author:
Peter Runge

Constructor Summary
ResourceMetadataKey(String resourceBundleName, String prefix, Class valueClass)
          Constructs a ResourceMetadataKey.
 
Method Summary
 String getDescription(Locale locale)
          Returns the description of the metadata key using the specified locale.
 String getName(Locale locale)
          Returns the name of the metadata key using the specified locale.
 Class getValueClass()
          Returns the class of the data that would be returned for this key.
 String toString()
          Returns a string representation of this key.
 
Methods inherited from class au.com.prunge.jgenfile.metadata.AbstractMetadataKey
getDescription, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceMetadataKey

public ResourceMetadataKey(String resourceBundleName,
                           String prefix,
                           Class valueClass)
                    throws NullPointerException
Constructs a ResourceMetadataKey.

Parameters:
resourceBundleName - the name of the resource bundle for getting values.
prefix - the prefix to use when getting values from the resource bundle. For example, to get the description for a ParameterKey with a prefix of "my", the key used in the resource bundle would be "my.description".
valueClass - the value class to use for this key.
Throws:
NullPointerException - if any parameter is null.
Method Detail

getDescription

public String getDescription(Locale locale)
                      throws NullPointerException
Description copied from interface: MetadataKey
Returns the description of the metadata key using the specified locale. Descriptions are typically a sentence in length.

Parameters:
locale - the locale to use.
Returns:
the description of the key.
Throws:
NullPointerException - if locale is null.
See Also:
MetadataKey.getDescription(java.util.Locale)

getName

public String getName(Locale locale)
               throws NullPointerException
Description copied from interface: MetadataKey
Returns the name of the metadata key using the specified locale.

Parameters:
locale - the locale to use.
Returns:
the name of the key.
Throws:
NullPointerException - if locale is null.
See Also:
MetadataKey.getName(java.util.Locale)

getValueClass

public Class getValueClass()
Description copied from interface: MetadataKey
Returns the class of the data that would be returned for this key. For example, if this key is used to access the last modified date of a file, this method should return the java.util.Date class.

Returns:
the class of the data returned using this key.
See Also:
au.com.prunge.jgenfilemetadata.MetadataKey#getValueClass()

toString

public String toString()
Returns a string representation of this key.

Overrides:
toString in class Object
Returns:
a string representation of this key.