org.apache.myfaces.extensions.validator.core.metadata
Class MetaDataEntry

java.lang.Object
  extended by org.apache.myfaces.extensions.validator.core.metadata.MetaDataEntry

public class MetaDataEntry
extends Object

Data holder which stores the meta-data and some information where the meta-data was found.

Since:
1.x.1
Author:
Gerhard Petracek

Field Summary
protected  Logger logger
           
 
Constructor Summary
MetaDataEntry()
           
 
Method Summary
 boolean equals(Object o)
           
 String getKey()
          Returns the key which identifies the meta-data.
 Object getProperty(String key)
          Returns the property-value for the given property-key.
<T> T
getProperty(String key, Class<T> targetClass)
          Returns the property-value for the given property-key.
 Object getValue()
          Returns the meta-data or a data-structure which represents the meta-data.
<T> T
getValue(Class<T> targetClass)
          Returns the meta-data or a data-structure which represents the meta-data.
 int hashCode()
           
 void setKey(String key)
          Sets the key of the meta-data.
 void setProperties(Map<String,Object> properties)
          Sets the map which contains further properties which are linked to the meta-data.
 void setProperty(String key, Object value)
          Sets the property-value for the given property-key.
 void setValue(Object value)
          Sets the object which represents the meta-data hold by this instance.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final Logger logger
Constructor Detail

MetaDataEntry

public MetaDataEntry()
Method Detail

getKey

public String getKey()
Returns the key which identifies the meta-data.

Returns:
key of the meta-data.

setKey

public void setKey(String key)
Sets the key of the meta-data. It's suggested to use the fully qualified name of a constraint.

Parameters:
key - value identifies the the meta-data stored in the instance.

getValue

public Object getValue()
Returns the meta-data or a data-structure which represents the meta-data.

Returns:
the meta-data or a data-structure which represents the meta-data.

getValue

public <T> T getValue(Class<T> targetClass)
Returns the meta-data or a data-structure which represents the meta-data.

Type Parameters:
T - generic type
Parameters:
targetClass - Type to which the return value must be casted.
Returns:
the meta-data or a data-structure which represents the meta-data.

setValue

public void setValue(Object value)
Sets the object which represents the meta-data hold by this instance.

Parameters:
value - the object which represents the meta-data hold by this instance.

setProperties

public void setProperties(Map<String,Object> properties)
Sets the map which contains further properties which are linked to the meta-data.

Parameters:
properties - properties which are linked to the meta-data.

getProperty

public Object getProperty(String key)
Returns the property-value for the given property-key.

Parameters:
key - key value used to identify the property value.
Returns:
property value for the specified key.

getProperty

public <T> T getProperty(String key,
                         Class<T> targetClass)
Returns the property-value for the given property-key.

Type Parameters:
T - Generic type
Parameters:
key - key which identifies a property
targetClass - Type to which the return value must be casted.
Returns:
property value for the specified key.

setProperty

public void setProperty(String key,
                        Object value)
Sets the property-value for the given property-key. PropertyInformationKeys contains the keys used by ExtVal.

Parameters:
key - key value used to identify the property value.
value - property value to set.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.