org.apache.commons.clazz.reflect.common
Class ReflectedAccessorPairProperty

java.lang.Object
  extended by org.apache.commons.clazz.common.ClazzElementSupport
      extended by org.apache.commons.clazz.common.ClazzFeatureSupport
          extended by org.apache.commons.clazz.reflect.common.ReflectedAccessorPairProperty
All Implemented Interfaces:
ClazzElement, ClazzFeature, ClazzProperty, ReflectedProperty
Direct Known Subclasses:
ReflectedListProperty, ReflectedMappedProperty, ReflectedScalarProperty

public class ReflectedAccessorPairProperty
extends ClazzFeatureSupport
implements ReflectedProperty

Version:
$Id: ReflectedAccessorPairProperty.java 155436 2005-02-26 13:17:48Z dirkv $
Author:
Dmitri Plotnikov

Constructor Summary
ReflectedAccessorPairProperty(Clazz declaringClazz, String name)
          Constructor for ReflectedClazzProperty.
 
Method Summary
 Object get(Object instance)
           
 String[] getAliases()
          Returns the aliases.
 Clazz getClazz()
          Returns the property type.
 Clazz getContentClazz()
          Gets the type of the item if the property isCollection() or isMap().
 Field getField()
          Returns the field.
 Clazz getKeyClazz()
          Gets the type of the key if the property isMap().
 String getName()
          Returns the name of the property.
 Method getReadMethod()
          Returns the readMethod.
 Class getType()
          Returns the type.
 Method getWriteMethod()
          Returns the writeMethod.
 boolean isCollection()
          Returns true if the property is a collection.
 boolean isMap()
          Returns true if the property is a map.
 boolean isReadOnly()
           
 void set(Object instance, Object value)
           
 void setAliases(String[] aliases)
          Sets the aliases.
 void setField(Field field)
          Sets the field.
 void setReadMethod(Method readMethod)
          Sets the readMethod.
 void setType(Class type)
          Sets the type.
 void setWriteMethod(Method writeMethod)
          Sets the writeMethod.
 
Methods inherited from class org.apache.commons.clazz.common.ClazzFeatureSupport
getDeclaringClazz
 
Methods inherited from class org.apache.commons.clazz.common.ClazzElementSupport
getAttribute, getAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.clazz.ClazzFeature
getDeclaringClazz
 
Methods inherited from interface org.apache.commons.clazz.ClazzElement
getAttribute, getAttributes
 

Constructor Detail

ReflectedAccessorPairProperty

public ReflectedAccessorPairProperty(Clazz declaringClazz,
                                     String name)
Constructor for ReflectedClazzProperty.

Method Detail

getName

public String getName()
Description copied from interface: ClazzProperty
Returns the name of the property.

Specified by:
getName in interface ClazzProperty
Returns:
String
See Also:
ClazzProperty.getName()

getAliases

public String[] getAliases()
Returns the aliases.

Specified by:
getAliases in interface ReflectedProperty
Returns:
String[]

setAliases

public void setAliases(String[] aliases)
Sets the aliases.

Parameters:
aliases - The aliases to set

getClazz

public Clazz getClazz()
Description copied from interface: ClazzProperty
Returns the property type.

Specified by:
getClazz in interface ClazzProperty
See Also:
ClazzProperty.getClazz()

getContentClazz

public Clazz getContentClazz()
Description copied from interface: ClazzProperty
Gets the type of the item if the property isCollection() or isMap().

Specified by:
getContentClazz in interface ClazzProperty
Returns:
the type of the item
See Also:
ClazzProperty.getContentClazz()

getKeyClazz

public Clazz getKeyClazz()
Description copied from interface: ClazzProperty
Gets the type of the key if the property isMap().

Specified by:
getKeyClazz in interface ClazzProperty
Returns:
the type of the key
See Also:
ClazzProperty.getKeyClazz()

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface ClazzProperty
Returns:
true if the property can not be changed
See Also:
ClazzProperty.isReadOnly()

getField

public Field getField()
Returns the field.

Returns:
Field

getReadMethod

public Method getReadMethod()
Returns the readMethod.

Returns:
Method

setField

public void setField(Field field)
Sets the field.

Parameters:
field - The field to set

setReadMethod

public void setReadMethod(Method readMethod)
Sets the readMethod.

Parameters:
readMethod - The readMethod to set

getWriteMethod

public Method getWriteMethod()
Returns the writeMethod.

Returns:
Method

setWriteMethod

public void setWriteMethod(Method writeMethod)
Sets the writeMethod.

Parameters:
writeMethod - The writeMethod to set

get

public Object get(Object instance)
Specified by:
get in interface ClazzProperty
See Also:
ClazzProperty.get(java.lang.Object)

set

public void set(Object instance,
                Object value)
Specified by:
set in interface ClazzProperty
See Also:
ClazzProperty.set(Object, Object)

getType

public Class getType()
Returns the type.

Returns:
Class

setType

public void setType(Class type)
Sets the type.

Parameters:
type - The type to set

isCollection

public boolean isCollection()
Description copied from interface: ClazzProperty
Returns true if the property is a collection.

Specified by:
isCollection in interface ClazzProperty
See Also:
ClazzProperty.isCollection()

isMap

public boolean isMap()
Description copied from interface: ClazzProperty
Returns true if the property is a map.

Specified by:
isMap in interface ClazzProperty
See Also:
ClazzProperty.isMap()


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