org.mtzky.reflect
クラス PropDesc

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

public class PropDesc
extends java.lang.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(java.lang.reflect.Field field)
           
PropDesc(java.lang.reflect.Method accessor)
           
PropDesc(java.lang.reflect.Method getter, java.lang.reflect.Method setter)
           
PropDesc(java.lang.String name, java.lang.Class<?> beanClass)
           
PropDesc(java.lang.String name, java.lang.reflect.Field field)
           
PropDesc(java.lang.String name, java.lang.reflect.Method getter, java.lang.reflect.Method setter)
           
 
メソッドの概要
<T> T
get(java.lang.Object obj)
           Gets a property value from the object.
<T extends java.lang.annotation.Annotation>
T
getAnnotation(java.lang.Class<T> annotationClass)
           
 java.lang.annotation.Annotation[] getAnnotations()
           
 java.lang.String getName()
           
 java.lang.Class<?> getType()
           
 boolean hasField()
           
 boolean hasGetter()
           
 boolean hasSetter()
           
 void set(java.lang.Object obj, java.lang.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(java.lang.String name,
                java.lang.Class<?> beanClass)
パラメータ:
name -
beanClass -

PropDesc

public PropDesc(java.lang.reflect.Method accessor)
パラメータ:
accessor -

PropDesc

public PropDesc(java.lang.reflect.Method getter,
                java.lang.reflect.Method setter)
パラメータ:
getter -
setter -

PropDesc

public PropDesc(java.lang.String name,
                java.lang.reflect.Method getter,
                java.lang.reflect.Method setter)
パラメータ:
name -
getter -
setter -

PropDesc

public PropDesc(java.lang.reflect.Field field)
パラメータ:
field -

PropDesc

public PropDesc(java.lang.String name,
                java.lang.reflect.Field field)
パラメータ:
name -
field -
メソッドの詳細

get

public <T> T get(java.lang.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(java.lang.Object obj,
                java.lang.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 java.lang.Class<?> getType()
戻り値:
property type

getName

public java.lang.String getName()

hasGetter

public boolean hasGetter()

hasSetter

public boolean hasSetter()

hasField

public boolean hasField()

getAnnotations

public java.lang.annotation.Annotation[] getAnnotations()

getAnnotation

public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)


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