|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.rad.type.AbstractType<T>
javax.rad.type.bean.AbstractBeanType<java.lang.Object>
javax.rad.type.bean.BeanType
public class BeanType
The BeanType is a wrapper for dynamic/generic beans and POJOs. With this
class you can set/get properties without get/set methods.
| Field Summary | |
|---|---|
protected java.lang.Class |
beanClass
The bean class. |
protected java.lang.reflect.Method[] |
getMethods
The get methods. |
protected java.lang.reflect.Method[] |
setMethods
The set methods. |
| Fields inherited from class javax.rad.type.bean.AbstractBeanType |
|---|
className, propertyDefinitions, propertyNames |
| Fields inherited from interface javax.rad.type.IType |
|---|
UNKNOWN_TYPE |
| Constructor Summary | |
|---|---|
|
BeanType()
Constructs a new BeanType. |
protected |
BeanType(java.lang.Class pBeanClass)
Constructs a new BeanType from a POJO. |
|
BeanType(PropertyDefinition... pPropertyDefinitions)
Constructs a new BeanType with given PropertyDefinitions. |
|
BeanType(java.lang.String... pPropertyNames)
Constructs a new BeanType with given property names. |
|
BeanType(java.lang.String pClassName,
PropertyDefinition[] pPropertyDefinitions)
Constructs a new BeanType with given class name and PropertyDefinitions. |
|
BeanType(java.lang.String pClassName,
java.lang.String[] pPropertyNames)
Constructs a new BeanType with given class name and property list. |
| Method Summary | |
|---|---|
java.lang.Object |
clone(java.lang.Object pObject)
Clones a bean. |
int |
compareTo(java.lang.Object object1,
java.lang.Object object2)
Compares two objects. |
protected PropertyDefinition |
createPropertyDefinition(java.lang.String pPropertyName,
java.lang.Class pPropertyType)
Creates the PropertyDefinition. |
java.lang.Object |
get(java.lang.Object pObject,
int pPropertyIndex)
Gets the value for a bean. |
java.lang.Object |
get(java.lang.Object pObject,
java.lang.String pPropertyName)
Gets a value from a bean. |
static BeanType |
getBeanType(java.lang.Class pBeanClass)
Gets a singleton instance of BeanType for the given bean class. |
static BeanType |
getBeanType(java.lang.Object pObject)
Gets the BeanType for the given bean. |
java.lang.reflect.Method |
getGetMethod(java.lang.String pPropertyName)
Gets the method for getting a value, in case of a class based BeanType and the property exists, null otherwise. |
java.lang.reflect.Method |
getSetMethod(java.lang.String pPropertyName)
Gets the method for getting a value, in case of a class based BeanType and the property exists, null otherwise. |
java.lang.Class |
getTypeClass()
Returns the class used by this type. |
java.lang.Object |
newInstance()
Creates a new instance of the bean. |
void |
put(java.lang.Object pObject,
int pPropertyIndex,
java.lang.Object pValue)
Sets the value for a bean. |
void |
put(java.lang.Object pObject,
java.lang.String pPropertyName,
java.lang.Object pValue)
Sets the value for a bean. |
java.lang.Object |
valueOf(java.lang.Object pObject)
Converts the object to an Object which is an instance of type class. |
| Methods inherited from class javax.rad.type.bean.AbstractBeanType |
|---|
addPropertyDefinition, addPropertyDefinition, createPropertyDefinition, createPropertyDefinitions, equals, getClassName, getPropertyCount, getPropertyDefinition, getPropertyDefinition, getPropertyIndex, getPropertyNames, hashCode, removeAllPropertyDefinitions |
| Methods inherited from class javax.rad.type.AbstractType |
|---|
equals, getTypeFromClass, getTypeFromObject, hashCode, registerType, toString, validatedValueOf |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected transient java.lang.Class beanClass
protected transient java.lang.reflect.Method[] getMethods
protected transient java.lang.reflect.Method[] setMethods
| Constructor Detail |
|---|
public BeanType()
BeanType.
public BeanType(java.lang.String... pPropertyNames)
BeanType with given property names.
pPropertyNames - the bean properties.
public BeanType(java.lang.String pClassName,
java.lang.String[] pPropertyNames)
BeanType with given class name and property list.
pClassName - the class name.pPropertyNames - the bean properties.public BeanType(PropertyDefinition... pPropertyDefinitions)
BeanType with given PropertyDefinitions.
pPropertyDefinitions - the bean properties.
public BeanType(java.lang.String pClassName,
PropertyDefinition[] pPropertyDefinitions)
BeanType with given class name and PropertyDefinitions.
pClassName - the class name.pPropertyDefinitions - the bean properties.protected BeanType(java.lang.Class pBeanClass)
BeanType from a POJO.
pBeanClass - the bean class.| Method Detail |
|---|
public java.lang.Class getTypeClass()
public java.lang.Object valueOf(java.lang.Object pObject)
Object which is an instance of type class.
valueOf in interface IType<java.lang.Object>valueOf in class AbstractType<java.lang.Object>pObject - the Object to convert
Object which is an instance of type class.
public int compareTo(java.lang.Object object1,
java.lang.Object object2)
object1 - the first object.object2 - the second object.
public static BeanType getBeanType(java.lang.Class pBeanClass)
pBeanClass - the POJO class.
public static BeanType getBeanType(java.lang.Object pObject)
pObject - the bean.
protected PropertyDefinition createPropertyDefinition(java.lang.String pPropertyName,
java.lang.Class pPropertyType)
pPropertyName - the property name.pPropertyType - the property type.
public java.lang.Object newInstance()
public java.lang.Object get(java.lang.Object pObject,
int pPropertyIndex)
pObject - the bean.pPropertyIndex - the property index.
public void put(java.lang.Object pObject,
int pPropertyIndex,
java.lang.Object pValue)
pObject - the bean.pPropertyIndex - the property index.pValue - the value of the property index.
public java.lang.Object get(java.lang.Object pObject,
java.lang.String pPropertyName)
pObject - the bean.pPropertyName - the property name.
public void put(java.lang.Object pObject,
java.lang.String pPropertyName,
java.lang.Object pValue)
pObject - the bean.pPropertyName - the property name.pValue - the value of the property name.public java.lang.reflect.Method getGetMethod(java.lang.String pPropertyName)
pPropertyName - the property name.
public java.lang.reflect.Method getSetMethod(java.lang.String pPropertyName)
pPropertyName - the property name.
public java.lang.Object clone(java.lang.Object pObject)
pObject - the bean.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||