public class GetterClassProperty<Type,TargetType> extends java.lang.Object implements ClassProperty<Type,TargetType>
isTypeCompatible(Method, Method)| Constructor and Description |
|---|
GetterClassProperty(java.lang.reflect.Method getter) |
GetterClassProperty(java.lang.reflect.Method getter,
java.lang.reflect.Method setter) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object object) |
java.lang.reflect.ParameterizedType |
getGenericType() |
java.lang.reflect.Method |
getGetter() |
ClassPropertyKey |
getKey() |
java.lang.reflect.Method |
getSetter() |
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 setter wasn't specified for this property. |
boolean |
isStatic() |
static boolean |
isTypeCompatible(java.lang.reflect.Method getter,
java.lang.reflect.Method setter)
Checks if return type of the specified getter is compatible with the type of the first argument of the
specified setter.
|
void |
setValue(TargetType target,
Type value)
If
ClassProperty.isStatic() returns true - specified target is ignored and may be null |
java.lang.String |
toString() |
public GetterClassProperty(java.lang.reflect.Method getter)
public GetterClassProperty(java.lang.reflect.Method getter,
java.lang.reflect.Method setter)
public static boolean isTypeCompatible(java.lang.reflect.Method getter,
java.lang.reflect.Method setter)
java.lang.IndexOutOfBoundsException - if specified setter has no argumentspublic 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.Method getGetter()
public java.lang.reflect.Method getSetter()
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 getter cannot be accessedjava.lang.IllegalAccessException - if property getter is inaccessible.java.lang.IllegalArgumentException - if property getter is an
instance method and the specified object argument
is not an instance of the class or interface
declaring the underlying method (or of a subclass
or implementor thereof);java.lang.reflect.InvocationTargetException - if the underlying method throws an exception.java.lang.NullPointerException - if the specified object is null and the method is an instance method.java.lang.ExceptionInInitializerError - if the initialization provoked by this method fails.java.lang.ExceptionMethod.invoke(Object, Object...)public void setValue(TargetType target, Type value) throws java.lang.Exception, java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
ClassPropertyClassProperty.isStatic() returns true - specified target is ignored and may be nullsetValue in interface ClassProperty<Type,TargetType>java.lang.UnsupportedOperationException - is isMutable() returns false.java.lang.SecurityException - if property getter cannot be accessedjava.lang.IllegalAccessException - if property getter is inaccessible.java.lang.IllegalArgumentException - if property getter is an
instance method and the specified object argument
is not an instance of the class or interface
declaring the underlying method (or of a subclass
or implementor thereof);java.lang.reflect.InvocationTargetException - if the underlying method throws an exception.java.lang.NullPointerException - if the specified object is null and the method is an instance method.java.lang.ExceptionInInitializerError - if the initialization provoked by this method fails.java.lang.ExceptionMethod.invoke(Object, Object...)public boolean isMutable()
false if setter wasn't specified for this property.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