to.etc.util
Class PropertyInfo

java.lang.Object
  extended by to.etc.util.PropertyInfo
All Implemented Interfaces:
IPropertyAccessor

@Immutable
public final class PropertyInfo
extends java.lang.Object
implements IPropertyAccessor

Information on properties on a class.

Author:
Frits Jalvingh Created on Aug 9, 2007

Constructor Summary
PropertyInfo(java.lang.String name, java.lang.reflect.Method getter, java.lang.reflect.Method setter)
           
 
Method Summary
 java.lang.reflect.Type getActualGenericType()
           
 java.lang.Class<?> getActualType()
           
 java.lang.Class<?> getCollectionValueType()
           
 java.lang.reflect.Method getGetter()
           
 java.lang.String getName()
           
 java.lang.reflect.Method getSetter()
           
 java.lang.Object getValue(java.lang.Object instance)
           
 boolean isArrayType()
           
 boolean isCollectionOrArrayType()
          Returns T if this is either a collection or an array.
 boolean isCollectionType()
           
 void setValue(java.lang.Object instance, java.lang.Object value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyInfo

public PropertyInfo(java.lang.String name,
                    java.lang.reflect.Method getter,
                    java.lang.reflect.Method setter)
Method Detail

getName

@Nonnull
public java.lang.String getName()
Specified by:
getName in interface IPropertyAccessor

getGetter

@Nonnull
public java.lang.reflect.Method getGetter()

getSetter

@Nullable
public java.lang.reflect.Method getSetter()

getActualType

@Nonnull
public java.lang.Class<?> getActualType()
Specified by:
getActualType in interface IPropertyAccessor

getActualGenericType

public java.lang.reflect.Type getActualGenericType()
Specified by:
getActualGenericType in interface IPropertyAccessor

isCollectionOrArrayType

public boolean isCollectionOrArrayType()
Returns T if this is either a collection or an array.

Returns:

isCollectionType

public boolean isCollectionType()

isArrayType

public boolean isArrayType()

getCollectionValueType

public java.lang.Class<?> getCollectionValueType()

getValue

@Nullable
public java.lang.Object getValue(@Nullable
                                          java.lang.Object instance)
                          throws java.lang.Exception
Specified by:
getValue in interface IPropertyAccessor
Throws:
java.lang.Exception

setValue

public void setValue(@Nullable
                     java.lang.Object instance,
                     @Nullable
                     java.lang.Object value)
              throws java.lang.Exception
Specified by:
setValue in interface IPropertyAccessor
Throws:
java.lang.Exception

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object