org.slim3.commons.beanutil
Class PropertyDesc

java.lang.Object
  extended by org.slim3.commons.beanutil.PropertyDesc

public final class PropertyDesc
extends Object

This class describes a property.

Since:
3.0
Author:
higa

Method Summary
 Class<?> getBeanClass()
          Returns the bean class.
 Field getField()
          Returns the field.
 ParameterizedClassDesc getParameterizedClassDesc()
          Returns the parameterized class descriptor.
 Class<?> getPropertyClass()
          Returns the property class
 String getPropertyName()
          Returns the property name.
 Method getReadMethod()
          Returns the read method.
 Object getValue(Object bean)
          Returns the property value.
 Method getWriteMethod()
          Returns the write method.
 boolean isReadable()
          Determines if this property is readable.
 boolean isWritable()
          Determines if this property is writable.
 void setValue(Object bean, Object value)
          Sets the property value to the bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPropertyName

public String getPropertyName()
Returns the property name.

Returns:
the property name

getPropertyClass

public Class<?> getPropertyClass()
Returns the property class

Returns:
the property class.

getBeanClass

public Class<?> getBeanClass()
Returns the bean class.

Returns:
the bean class

getReadMethod

public Method getReadMethod()
Returns the read method.

Returns:
the read method

isReadable

public boolean isReadable()
Determines if this property is readable.

Returns:
whether this property is readable

getWriteMethod

public Method getWriteMethod()
Returns the write method.

Returns:
the write method

isWritable

public boolean isWritable()
Determines if this property is writable.

Returns:
whether this property is writable

getField

public Field getField()
Returns the field.

Returns:
the field

getValue

public Object getValue(Object bean)
                throws PropertyNotReadableRuntimeException,
                       PropertyCanNotReadRuntimeException
Returns the property value.

Parameters:
bean - the bean
Returns:
the value.
Throws:
PropertyNotReadableRuntimeException - if the property is not readable
PropertyCanNotReadRuntimeException - if an exception is encountered while trying to read the property

setValue

public void setValue(Object bean,
                     Object value)
              throws PropertyNotWritableRuntimeException,
                     PropertyCanNotWriteRuntimeException
Sets the property value to the bean.

Parameters:
bean - the bean
value - the value
Throws:
PropertyNotWritableRuntimeException - if the property is not writable
PropertyCanNotWriteRuntimeException - if an other exception is encountered while trying to write value to the property

getParameterizedClassDesc

public ParameterizedClassDesc getParameterizedClassDesc()
Returns the parameterized class descriptor.

Returns:
the parameterized class descriptor


Copyright © 2008-2009 The Slim3 project. All Rights Reserved.