net.dpml.metro.info
Class EntryDescriptor

java.lang.Object
  extended by net.dpml.metro.info.EntryDescriptor
All Implemented Interfaces:
Serializable, Comparable

public final class EntryDescriptor
extends Object
implements Serializable, Comparable

A descriptor that describes a value that must be placed in components Context. It contains information about;

Version:
1.0.4
Author:
Digital Product Meta Library
See Also:
Serialized Form

Field Summary
static String GET
          Constant prefix for get operations.
static boolean OPTIONAL
          Optional constant.
static boolean REQUIRED
          Required constant.
 
Constructor Summary
EntryDescriptor(String key, String classname)
          Construct an non-volotile required EntryDescriptor.
EntryDescriptor(String key, String classname, boolean optional)
          Construct an non-volotile EntryDescriptor.
EntryDescriptor(String key, String classname, boolean optional, boolean isVolatile)
          Construct an EntryDescriptor.
 
Method Summary
 int compareTo(Object other)
          Compare this entry with another entry.
 boolean equals(Object other)
          Test is the supplied object is equal to this object.
 String getClassname()
          Return the type of value that is stored in the context entry.
static String getEntryKey(Method method)
          Utility function that covers a supplied method to a entry name.
 String getKey()
          Return the key that Component uses to lookup entry.
 boolean getOptional()
          Return true if entry is optional, false otherwise.
 boolean getVolatile()
          Return true if entry is volotile.
 int hashCode()
          Return the hashcode for the object.
 boolean isOptional()
          Return true if entry is optional, false otherwise.
 boolean isRequired()
          Return true if entry is required, false otherwise.
 boolean isVolatile()
          Return true if entry is volotile.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GET

public static final String GET
Constant prefix for get operations.

See Also:
Constant Field Values

OPTIONAL

public static final boolean OPTIONAL
Optional constant.

See Also:
Constant Field Values

REQUIRED

public static final boolean REQUIRED
Required constant.

See Also:
Constant Field Values
Constructor Detail

EntryDescriptor

public EntryDescriptor(String key,
                       String classname)
                throws NullPointerException
Construct an non-volotile required EntryDescriptor.

Parameters:
key - the context entry key
classname - the classname of the context entry
Throws:
NullPointerException - if the key or type value are null

EntryDescriptor

public EntryDescriptor(String key,
                       String classname,
                       boolean optional)
                throws NullPointerException
Construct an non-volotile EntryDescriptor.

Parameters:
key - the context entry key
classname - the classname of the context entry
optional - TRUE if this is an optional entry
Throws:
NullPointerException - if the key or type value are null

EntryDescriptor

public EntryDescriptor(String key,
                       String classname,
                       boolean optional,
                       boolean isVolatile)
                throws NullPointerException
Construct an EntryDescriptor.

Parameters:
key - the context entry key
classname - the classname of the context entry
optional - TRUE if this is an optional entry
isVolatile - TRUE if the entry is consider to be immutable
Throws:
NullPointerException - if the key or type value are null
Method Detail

getEntryKey

public static String getEntryKey(Method method)
Utility function that covers a supplied method to a entry name.

Parameters:
method - the method
Returns:
the key
See Also:
Introspector.decapitalize(String)

getKey

public String getKey()
Return the key that Component uses to lookup entry.

Returns:
the key that Component uses to lookup entry.

getClassname

public String getClassname()
Return the type of value that is stored in the context entry.

Returns:
the context entry classname

getOptional

public boolean getOptional()
Return true if entry is optional, false otherwise.

Returns:
true if entry is optional, false otherwise.

isOptional

public boolean isOptional()
Return true if entry is optional, false otherwise.

Returns:
true if entry is optional, false otherwise.

isRequired

public boolean isRequired()
Return true if entry is required, false otherwise.

Returns:
true if entry is required, false otherwise.

isVolatile

public boolean isVolatile()
Return true if entry is volotile.

Returns:
the volatile state of the entry

getVolatile

public boolean getVolatile()
Return true if entry is volotile.

Returns:
the volatile state of the entry

equals

public boolean equals(Object other)
Test is the supplied object is equal to this object.

Overrides:
equals in class Object
Parameters:
other - the object to compare with this instance
Returns:
true if the object are equivalent

hashCode

public int hashCode()
Return the hashcode for the object.

Overrides:
hashCode in class Object
Returns:
the hashcode value

compareTo

public int compareTo(Object other)
Compare this entry with another entry.

Specified by:
compareTo in interface Comparable
Parameters:
other - the other object
Returns:
the comparative index