public final class PropertyAccessor extends java.lang.Object implements MutableAccessor
Constructor and Description |
---|
PropertyAccessor(java.lang.String name,
java.lang.Class<?> type,
java.lang.reflect.Method readMethod,
java.lang.reflect.Method writeMethod) |
Modifier and Type | Method and Description |
---|---|
<T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<T> annotationClass) |
java.lang.reflect.Type |
getGenericType() |
java.lang.String |
getGetterName() |
java.lang.String |
getName() |
java.lang.Class<?> |
getValueClass() |
boolean |
isWritable() |
java.lang.Object |
read(java.lang.Object o) |
boolean |
readBoolean(java.lang.Object o) |
double |
readDouble(java.lang.Object o) |
float |
readFloat(java.lang.Object o) |
int |
readInt(java.lang.Object o) |
long |
readLong(java.lang.Object o) |
java.lang.Object |
readUnsafe(java.lang.Object o) |
void |
set(java.lang.Object host,
java.lang.Object value) |
void |
setBoolean(java.lang.Object host,
boolean value) |
void |
setDouble(java.lang.Object host,
double value) |
void |
setFloat(java.lang.Object host,
float value) |
void |
setInt(java.lang.Object host,
int value) |
void |
setLong(java.lang.Object host,
long value) |
void |
setShort(java.lang.Object host,
short value) |
java.lang.String |
toString() |
public PropertyAccessor(java.lang.String name, java.lang.Class<?> type, java.lang.reflect.Method readMethod, java.lang.reflect.Method writeMethod)
public java.lang.String getGetterName()
public java.lang.Object readUnsafe(java.lang.Object o) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
readUnsafe
in interface Accessor
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public int readInt(java.lang.Object o) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
public long readLong(java.lang.Object o) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
public float readFloat(java.lang.Object o) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
public double readDouble(java.lang.Object o) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
readDouble
in interface Accessor
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public boolean readBoolean(java.lang.Object o) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
readBoolean
in interface Accessor
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public void set(java.lang.Object host, java.lang.Object value)
set
in interface MutableAccessor
public void setBoolean(java.lang.Object host, boolean value)
setBoolean
in interface MutableAccessor
public void setInt(java.lang.Object host, int value)
setInt
in interface MutableAccessor
public void setShort(java.lang.Object host, short value)
setShort
in interface MutableAccessor
public void setLong(java.lang.Object host, long value)
setLong
in interface MutableAccessor
public void setDouble(java.lang.Object host, double value)
setDouble
in interface MutableAccessor
public void setFloat(java.lang.Object host, float value)
setFloat
in interface MutableAccessor
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
getAnnotation
in interface Accessor
public java.lang.Class<?> getValueClass()
getValueClass
in interface Accessor
public java.lang.reflect.Type getGenericType()
getGenericType
in interface Accessor
public boolean isWritable()
isWritable
in interface Accessor
public java.lang.String toString()
toString
in class java.lang.Object