public final class Bean<T>
extends java.lang.Object
Class or an interface.Property,
Class.getFields(),
Class.getMethods(),
Class.getDeclaredFields(),
Class.getDeclaredMethods()| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Compares this
Bean against the specified object. |
static <T> Bean<T> |
forClass(java.lang.Class<T> beanClass)
Introspects a
Class or an interface and learns about all
its Property elements. |
Property[] |
getDeclaredProperties()
Returns an array containing
Property objects reflecting all the
declared properties of the class or interface. |
Property |
getDeclaredProperty(java.lang.String propertyName)
Returns a single declared property of the analized class or interface,
if present, else
null. |
Property[] |
getProperties()
Returns an array containing
Property objects reflecting all the
public properties of the analized class or interface. |
Property |
getProperty(java.lang.String propertyName)
Returns a single public property of the analized class or interface,
if present, else
null. |
java.lang.Class<T> |
getType()
Returns the type of the analized class or interface.
|
int |
hashCode()
Returns a hashcode for this
Bean. |
java.lang.String |
toString()
Returns a textual rapresentation of this bean.
|
public static <T> Bean<T> forClass(java.lang.Class<T> beanClass)
Class or an interface and learns about all
its Property elements.
If the target type has been previously analized then the Bean
instance is retrieved from a thread-safe SoftReference cache.
beanClass - the class or interface to analizeBean object describing the target class or interfacejava.lang.NullPointerException - if the given beanClass parameter is nullpublic java.lang.Class<T> getType()
public Property getProperty(java.lang.String propertyName)
null.propertyName - the name of the property to retrieveProperty searched, or null if not foundjava.lang.NullPointerException - if propertyName parameter is nullpublic Property getDeclaredProperty(java.lang.String propertyName)
null.propertyName - the name of the declared property to retrieveProperty searched, or null if not foundjava.lang.NullPointerException - if propertyName parameter is nullpublic Property[] getProperties()
Property objects reflecting all the
public properties of the analized class or interface.
The array includes those properties whose public Method accessors
are declared in the analized class or interface, or inherited from its
superclasses and superinterfaces.
The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers.
The elements in the returned array are not sorted and are not in any particular order.
public Property[] getDeclaredProperties()
Property objects reflecting all the
declared properties of the class or interface.
The array will include properties whose Method accessors are
public, protected, default (package) access, and private, but exclude
inherited accessors.
The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers.
The elements in the returned array are not sorted and are not in any particular order.
public boolean equals(java.lang.Object obj)
Bean against the specified object.
Returns true if the objects are the same. Two Bean are the
same if they analized the same class or interface.
equals in class java.lang.Objectobj - the object to comparepublic int hashCode()
Bean.hashCode in class java.lang.Objectpublic java.lang.String toString()
The string representation is the string "bean",
followed by a space, and then by the fully qualified name of
the type analized in the format returned by getName.
toString in class java.lang.ObjectCopyright © 2015 Minimalcode. All Rights Reserved.