|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjfun.util.beans.BeanType
public final class BeanType
Represents all the meta-information of a Java bean.
Zephyr Business Solutions Corp.
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
java.lang.Class |
getIndexedPropertyType(java.lang.String name)
Get the type of an indexed property. |
java.lang.reflect.Method |
getIndexedReader(java.lang.String name)
Get the reader method for an indexed property. |
java.lang.reflect.Method |
getIndexedWriter(java.lang.String name)
Get the writer method for an indexed property. |
java.beans.PropertyDescriptor |
getPropertyDescriptor(java.lang.String name)
Get the PropertyDescriptor for a given property. |
java.util.Set |
getPropertyNames()
Get the property names of this bean type. |
java.lang.reflect.Method |
getPropertySetter(java.lang.String name)
Get the setter method for a property. |
static java.lang.Class |
getPropertySetterType(java.beans.PropertyDescriptor desc)
Get the type of a property. |
java.lang.Class |
getPropertySetterType(java.lang.String name)
Get the type of the property. |
java.lang.Class |
getPropertyType(java.lang.String name)
Get the type of a property. |
java.lang.reflect.Method |
getReader(java.lang.String name)
Get the reader method of a property. |
java.lang.Class |
getType()
Get the type of this java bean. |
java.lang.reflect.Method |
getWriter(java.lang.String name)
Get the writer method of a property. |
int |
hashCode()
|
static BeanType |
instance(java.lang.Class type)
Get a BeanType object. |
void |
setProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object val)
Set value for a property of a bean of this type. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public java.lang.Class getType()
public java.util.Set getPropertyNames()
public static BeanType instance(java.lang.Class type) throws java.beans.IntrospectionException
type
- the type of the java bean.
java.Beans.IntrospectionException
java.beans.IntrospectionException
public java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String name)
name
- the property name.
public java.lang.Class getPropertyType(java.lang.String name) throws NoSuchPropertyException
name
- the name of the property.
NoSuchPropertyException
- when the property cannot be found.public java.lang.Class getPropertySetterType(java.lang.String name)
name
- the property name.
public java.lang.reflect.Method getPropertySetter(java.lang.String name)
name
- the property name.
public static java.lang.Class getPropertySetterType(java.beans.PropertyDescriptor desc)
desc
- the descriptor for the property.
public java.lang.Class getIndexedPropertyType(java.lang.String name) throws NoSuchPropertyException
name
- the name of the property.
NoSuchPropertyException
- when the property cannot be found.public java.lang.reflect.Method getWriter(java.lang.String name) throws NoSuchPropertyException
name
- the property name.
NoSuchPropertyException
- when the property cannot be found.public java.lang.reflect.Method getReader(java.lang.String name) throws NoSuchPropertyException
name
- the property name.
NoSuchPropertyException
- when the property cannot be found.public java.lang.reflect.Method getIndexedWriter(java.lang.String name) throws NoSuchPropertyException
name
- the property name.
NoSuchPropertyException
- when the property cannot be found.public java.lang.reflect.Method getIndexedReader(java.lang.String name) throws NoSuchPropertyException
name
- the property name.
NoSuchPropertyException
- when the property cannot be found.public void setProperty(java.lang.Object bean, java.lang.String name, java.lang.Object val) throws NoSuchPropertyException, PropertyNotWritableException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
This method also handles properties accessed by index. When the property requires an index, the value has to be an array or null, where null is equivalent to an empty array. *
The array elements are then set to the property by index from 0 up.
bean
- the bean object.name
- the property name.val
- the new value of the property.
NoSuchPropertyException
- when the property cannot be found.
PropertyNotWritableException
- when the property is not writable.
java.lang.reflect.InvocationTargetException
- any exception caused by the setter method.
java.lang.IllegalAccessException
- if access to the setter method failed.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |