|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.prosyst.util.beans.BeanUtils
public class BeanUtils
Utility class for processing Java Beans. It refers to the rather extensive JavaBeans Specification in a very constrained manner, not considering beans as "a reusable software component that can be manipulated visually in a builder tool", not taking into account their possible usage and not using their full set of features like events, persistence, etc. It just considers beans as Java classes that contain standard Java bean accessor methods for properties. A bean property is a value that can be retrieved and changed using standard accessor methods. These methods are two types: getters (readers, reader methods) and setters (writers, writer methods) and must respect some naming rules. Getters have the form 'getXxx' and 'isXxx', where 'xxx' is the name of the property. Setters have the form 'setXxx' where 'xxx' is the name of the property. So method names are constructed by appending the property name with capitalized first letter after 'get', 'is' or 'set'. A bean property has also a type. It is the same as the return type of the getter and the argument type of the setter method. Bean properties are represented by the BeanProperty and IndexedBeanProperty classes, which encapsulate the name and type of the property and its methods. BeanUtils uses reflection mechanisms to process classes. It caches the retrieved bean properties for faster access.
| Constructor Summary | |
|---|---|
BeanUtils()
|
|
| Method Summary | |
|---|---|
static void |
cleanCache()
Cleans the whole cache for all beans. |
static void |
cleanFromCache(java.lang.Class c)
Cleans the cached BeanProperty info for a given bean class. |
static BeanProperty |
getBeanProperty(java.lang.String name,
java.lang.Class beanClass)
Return a BeanProperty for the given property name. |
static BeanProperty |
getIndexedBeanProperty(java.lang.String name,
java.lang.Class beanClass)
Return an IndexedBeanProperty for the given property name. |
static java.lang.Object |
instantiate(java.lang.ClassLoader cls,
java.lang.String beanName)
Creates an instance of a class with the given name, using the provided ClassLoader. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BeanUtils()
| Method Detail |
|---|
public static final BeanProperty getBeanProperty(java.lang.String name,
java.lang.Class beanClass)
throws BeanException
name - property namebeanClass - bean class to process
BeanException
public static final BeanProperty getIndexedBeanProperty(java.lang.String name,
java.lang.Class beanClass)
throws BeanException
name - property namebeanClass - bean class to process
BeanExceptionpublic static void cleanFromCache(java.lang.Class c)
c - the class of the beanpublic static void cleanCache()
public static java.lang.Object instantiate(java.lang.ClassLoader cls,
java.lang.String beanName)
throws java.lang.ClassNotFoundException,
java.lang.InstantiationException,
java.lang.IllegalAccessException
cls - ClassLoader to use for class loading or nullbeanName - fully qualified java class name
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||