com.calitha.reflect
Class Property

java.lang.Object
  extended by com.calitha.reflect.Property

public class Property
extends Object

A property object represents information about a field in an object.


Constructor Summary
Property(String fieldName, Class fieldType)
          Create a property object without a set and get method.
Property(String fieldName, Class fieldType, Method getter, Method setter)
          Create a property object.
 
Method Summary
 String getFieldName()
          Gets the field name.
 Class getFieldType()
          Gets the field type.
 Method getGetter()
          Gets the getter method to access the field value.
 Method getSetter()
          Gets the setter method to access the field value.
 void setGetter(Method getter)
          Sets the getter method to access the field value.
 void setSetter(Method setter)
          Sets the setter method to access the field value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Property

public Property(String fieldName,
                Class fieldType,
                Method getter,
                Method setter)
Create a property object.

Parameters:
fieldName - field name
fieldType - field type
getter - method to get the field value, can be null if a get method is not available
setter - method to set the field value, can be null if a set method is not available

Property

public Property(String fieldName,
                Class fieldType)
Create a property object without a set and get method.

Parameters:
fieldName - field name
fieldType - field type
Method Detail

getFieldName

public String getFieldName()
Gets the field name.

Returns:
field name

getFieldType

public Class getFieldType()
Gets the field type.

Returns:
field type

getGetter

public Method getGetter()
Gets the getter method to access the field value.

Returns:
get method

getSetter

public Method getSetter()
Gets the setter method to access the field value.

Returns:
set method

setGetter

public void setGetter(Method getter)
Sets the getter method to access the field value.

Parameters:
getter - get method

setSetter

public void setSetter(Method setter)
Sets the setter method to access the field value.

Parameters:
setter - set method