org.mtzky.reflect
クラス PropDesc

java.lang.Object
  上位を拡張 org.mtzky.reflect.PropDesc

public class PropDesc
extends Object

Descriptors for Property (Getter, Setter , and public Field).

Note for getAnnotation(Class) and getAnnotations() method: Prevails the annotation on a getter method if same type is defined.

導入されたバージョン:
0.1.1
作成者:
mtzky

コンストラクタの概要
PropDesc(Field field)
           
PropDesc(Method accessor)
           
PropDesc(Method getter, Method setter)
           
PropDesc(String name, Class<?> beanClass)
           
PropDesc(String name, Field field)
           
PropDesc(String name, Method getter, Method setter)
           
 
メソッドの概要
<T> T
get(Object obj)
           Gets a property value from the object.
<T extends Annotation>
T
getAnnotation(Class<T> annotationClass)
           
 Annotation[] getAnnotations()
           
 Class<?> getDeclaringClass()
           Returns the Class object representing the class or interface that declares the Method or the Field represented by this PropDesc object.
 String getName()
           
 Class<?> getType()
           
 boolean hasField()
           
 boolean hasGetter()
           
 boolean hasSetter()
           
 void set(Object obj, Object value)
           Sets a property value to the object.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

PropDesc

public PropDesc(String name,
                Class<?> beanClass)
パラメータ:
name -
beanClass -
導入されたバージョン:
0.1.4

PropDesc

public PropDesc(Method accessor)
パラメータ:
accessor -
導入されたバージョン:
0.1.4

PropDesc

public PropDesc(Method getter,
                Method setter)
パラメータ:
getter -
setter -
導入されたバージョン:
0.1.4

PropDesc

public PropDesc(String name,
                Method getter,
                Method setter)
パラメータ:
name -
getter -
setter -
導入されたバージョン:
0.1.4

PropDesc

public PropDesc(Field field)
パラメータ:
field -
導入されたバージョン:
0.1.4

PropDesc

public PropDesc(String name,
                Field field)
パラメータ:
name -
field -
導入されたバージョン:
0.1.4
メソッドの詳細

get

public <T> T get(Object obj)

Gets a property value from the object. Returns null if an Exception occurred.

型パラメータ:
T -
パラメータ:
obj - the instance to get property value
戻り値:
property value
例外:
InvocationTargetRuntimeException - if failed to get

set

public void set(Object obj,
                Object value)

Sets a property value to the object. Returns false if an Exception occurred.

パラメータ:
obj - the instance to set property value
value -
例外:
InvocationTargetRuntimeException - if failed to set

getType

public Class<?> getType()
戻り値:
property type

getName

public String getName()

hasGetter

public boolean hasGetter()

hasSetter

public boolean hasSetter()

hasField

public boolean hasField()

getAnnotations

public Annotation[] getAnnotations()

getAnnotation

public <T extends Annotation> T getAnnotation(Class<T> annotationClass)

getDeclaringClass

public Class<?> getDeclaringClass()

Returns the Class object representing the class or interface that declares the Method or the Field represented by this PropDesc object.

戻り値:
an object representing the declaring class of the underlying member
導入されたバージョン:
0.1.5


Copyright (C) 2010-2011 Mtzky. AllRights Reserved.