|
||||||||||
| 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<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 Class |
beanClass
The bean class. |
protected Method[] |
getMethods
The get methods. |
protected 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(Class pBeanClass)
Constructs a new BeanType from a POJO. |
|
BeanType(PropertyDefinition[] pPropertyDefinitions)
Constructs a new BeanType with given PropertyDefinitions. |
|
BeanType(String[] pPropertyNames)
Constructs a new BeanType with given property names. |
|
BeanType(String pClassName,
PropertyDefinition[] pPropertyDefinitions)
Constructs a new BeanType with given class name and PropertyDefinitions. |
|
BeanType(String pClassName,
String[] pPropertyNames)
Constructs a new BeanType with given class name and property list. |
| Method Summary | |
|---|---|
Object |
clone(Object pObject)
Clones a bean. |
int |
compareTo(Object object1,
Object object2)
Compares two objects. |
protected PropertyDefinition |
createPropertyDefinition(String pPropertyName,
Class pPropertyType)
Creates the PropertyDefinition. |
Object |
get(Object pObject,
int pPropertyIndex)
Gets the value for a bean. |
Object |
get(Object pObject,
String pPropertyName)
Gets a value from a bean. |
static BeanType |
getBeanType(Class pBeanClass)
Gets a singleton instance of BeanType for the given bean class. |
static BeanType |
getBeanType(Object pObject)
Gets the BeanType for the given bean. |
Method |
getGetMethod(String pPropertyName)
Gets the method for getting a value, in case of a class based BeanType and the property exists, null otherwise. |
Method |
getSetMethod(String pPropertyName)
Gets the method for getting a value, in case of a class based BeanType and the property exists, null otherwise. |
Class |
getTypeClass()
Returns the class used by this type. |
Object |
newInstance()
Creates a new instance of the bean. |
void |
put(Object pObject,
int pPropertyIndex,
Object pValue)
Sets the value for a bean. |
void |
put(Object pObject,
String pPropertyName,
Object pValue)
Sets the value for a bean. |
Object |
valueOf(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 Class beanClass
protected transient Method[] getMethods
protected transient Method[] setMethods
| Constructor Detail |
|---|
public BeanType()
BeanType.
public BeanType(String[] pPropertyNames)
BeanType with given property names.
pPropertyNames - the bean properties.
public BeanType(String pClassName,
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(String pClassName,
PropertyDefinition[] pPropertyDefinitions)
BeanType with given class name and PropertyDefinitions.
pClassName - the class name.pPropertyDefinitions - the bean properties.protected BeanType(Class pBeanClass)
BeanType from a POJO.
pBeanClass - the bean class.| Method Detail |
|---|
public Class getTypeClass()
public Object valueOf(Object pObject)
Object which is an instance of type class.
valueOf in interface IType<Object>valueOf in class AbstractType<Object>pObject - the Object to convert
Object which is an instance of type class.
public int compareTo(Object object1,
Object object2)
object1 - the first object.object2 - the second object.
public static BeanType getBeanType(Class pBeanClass)
pBeanClass - the POJO class.
public static BeanType getBeanType(Object pObject)
pObject - the bean.
protected PropertyDefinition createPropertyDefinition(String pPropertyName,
Class pPropertyType)
pPropertyName - the property name.pPropertyType - the property type.
public Object newInstance()
public Object get(Object pObject,
int pPropertyIndex)
pObject - the bean.pPropertyIndex - the property index.
public void put(Object pObject,
int pPropertyIndex,
Object pValue)
pObject - the bean.pPropertyIndex - the property index.pValue - the value of the property index.
public Object get(Object pObject,
String pPropertyName)
pObject - the bean.pPropertyName - the property name.
public void put(Object pObject,
String pPropertyName,
Object pValue)
pObject - the bean.pPropertyName - the property name.pValue - the value of the property name.public Method getGetMethod(String pPropertyName)
pPropertyName - the property name.
public Method getSetMethod(String pPropertyName)
pPropertyName - the property name.
public Object clone(Object pObject)
pObject - the bean.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||