public class FieldClassProperty<Type,TargetType> extends java.lang.Object implements ClassProperty<Type,TargetType>
| Constructor and Description |
|---|
FieldClassProperty(java.lang.reflect.Field field) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object object) |
java.lang.reflect.Field |
getField() |
java.lang.reflect.ParameterizedType |
getGenericType() |
ClassPropertyKey |
getKey() |
java.lang.Class<Type> |
getType() |
Type |
getValue(TargetType target)
If
ClassProperty.isStatic() returns true - specified target is ignored and may be null |
Visibility |
getVisibility() |
int |
hashCode() |
boolean |
isMutable()
Returns
false if underlying field is final. |
boolean |
isStatic() |
void |
setValue(TargetType target,
Type value)
If
ClassProperty.isStatic() returns true - specified target is ignored and may be null |
java.lang.String |
toString() |
public ClassPropertyKey getKey()
getKey in interface ClassProperty<Type,TargetType>public java.lang.Class<Type> getType()
getType in interface ClassProperty<Type,TargetType>public java.lang.reflect.ParameterizedType getGenericType()
getGenericType in interface ClassProperty<Type,TargetType>public boolean isStatic()
isStatic in interface ClassProperty<Type,TargetType>public Visibility getVisibility()
getVisibility in interface ClassProperty<Type,TargetType>public java.lang.reflect.Field getField()
public Type getValue(TargetType target) throws java.lang.Exception
ClassPropertyClassProperty.isStatic() returns true - specified target is ignored and may be nullgetValue in interface ClassProperty<Type,TargetType>java.lang.SecurityException - if property field cannot be accessedjava.lang.IllegalAccessException - if property field is inaccessible.java.lang.IllegalArgumentException - if the specified target is not an
instance of the class or interface declaring the underlying
field (or a subclass or implementor thereof).java.lang.NullPointerException - if the specified target is null
and the field is an instance field.java.lang.ExceptionInInitializerError - if the initialization provoked
by this method fails.java.lang.ExceptionField.get(Object)public void setValue(TargetType target, Type value) throws java.lang.Exception
ClassPropertyClassProperty.isStatic() returns true - specified target is ignored and may be nullsetValue in interface ClassProperty<Type,TargetType>java.lang.UnsupportedOperationException - if isMutable() returns false.java.lang.SecurityException - if property field cannot be accessedjava.lang.IllegalAccessException - if property field is inaccessible.java.lang.IllegalArgumentException - if the specified object is not an
instance of the class or interface declaring the underlying
field (or a subclass or implementor thereof),
or if an unwrapping conversion fails.java.lang.NullPointerException - if the specified target is null
and the field is an instance field.java.lang.ExceptionInInitializerError - if the initialization provoked
by this method fails.java.lang.ExceptionField.set(Object, Object)public boolean isMutable()
false if underlying field is final.isMutable in interface ClassProperty<Type,TargetType>public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object