Package jadex.commons.beans
Class Introspector
- java.lang.Object
- 
- jadex.commons.beans.Introspector
 
- 
 public class Introspector extends java.lang.ObjectTheIntrospectoris a utility for developers to figure out which properties, events, and methods a JavaBean supports.Introspector class walks over the class/superclass chain of the target bean class. At each level it checks if there is a matching Introspector appends "BeanInfo" to the qualified name of the bean class, try to use the new class as the "BeanInfo" class. If the "BeanInfo" class exsits and returns non-null value when queried for explicit information, use the explicit informationIntrospector will extract a simple class name of the bean class by removing the package name from the qualified name of the bean class, append "BeanInfo" to it. And look for the simple class name in the packages defined in the "BeanInfo" search path (The default "BeanInfo" search path isBeanInfoclass which provides explicit information about the bean, and if so uses that explicit information. Otherwise it uses the low level reflection APIs to study the target class and uses design patterns to analyze its behaviour and then proceeds to continue the introspection with its baseclass.sun.beans.infos). If it finds a "BeanInfo" class and the "BeanInfo" class returns non-null value when queried for explicit information, use the explicit information- 
- 
Field SummaryFields Modifier and Type Field Description static intIGNORE_ALL_BEANINFOConstant values to indicate that theIntrospectorwill ignore allBeanInfoclass.static intIGNORE_IMMEDIATE_BEANINFOConstant values to indicate that theIntrospectorwill ignore theBeanInfoclass of the current bean class.static intUSE_ALL_BEANINFOConstant values to indicate that theIntrospectorwill use allBeanInfoclass which have been found.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringdecapitalize(java.lang.String name)Decapitalizes a given string according to the rule:static voidflushCaches()Flushes allBeanInfocaches.static voidflushFromCaches(java.lang.Class<?> clazz)Flushes theBeanInfocaches of the specified bean classstatic BeanInfogetBeanInfo(java.lang.Class<?> beanClass)Gets theBeanInfoobject which contains the information of the properties, events and methods of the specified bean class.static BeanInfogetBeanInfo(java.lang.Class<?> beanClass, int flags)Gets theBeanInfoobject which contains the information of the properties, events and methods of the specified bean class.static BeanInfogetBeanInfo(java.lang.Class<?> beanClass, java.lang.Class<?> stopClass)Gets theBeanInfoobject which contains the information of the properties, events and methods of the specified bean class.static java.lang.String[]getBeanInfoSearchPath()Gets an array of search packages.static voidsetBeanInfoSearchPath(java.lang.String[] path)Sets the search packages.
 
- 
 - 
- 
Field Detail- 
IGNORE_ALL_BEANINFOpublic static final int IGNORE_ALL_BEANINFO Constant values to indicate that theIntrospectorwill ignore allBeanInfoclass.- See Also:
- Constant Field Values
 
 - 
IGNORE_IMMEDIATE_BEANINFOpublic static final int IGNORE_IMMEDIATE_BEANINFO Constant values to indicate that theIntrospectorwill ignore theBeanInfoclass of the current bean class.- See Also:
- Constant Field Values
 
 - 
USE_ALL_BEANINFOpublic static final int USE_ALL_BEANINFO Constant values to indicate that theIntrospectorwill use allBeanInfoclass which have been found. This is the default one.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
decapitalizepublic static java.lang.String decapitalize(java.lang.String name) Decapitalizes a given string according to the rule:- Parameters:
- name- - the String to decapitalize
- Returns:
- the decapitalized version of the String
 - 
flushCachespublic static void flushCaches() Flushes allBeanInfocaches.
 - 
flushFromCachespublic static void flushFromCaches(java.lang.Class<?> clazz) Flushes theBeanInfocaches of the specified bean class- Parameters:
- clazz- the specified bean class
 
 - 
getBeanInfopublic static BeanInfo getBeanInfo(java.lang.Class<?> beanClass) throws IntrospectionException Gets theBeanInfoobject which contains the information of the properties, events and methods of the specified bean class.Introspector will cache the BeanInfoobject. Subsequent calls to this method will be answered with the cached data.- Parameters:
- beanClass- the specified bean class.
- Returns:
- the BeanInfoof the bean class.
- Throws:
- IntrospectionException
 - 
getBeanInfopublic static BeanInfo getBeanInfo(java.lang.Class<?> beanClass, java.lang.Class<?> stopClass) throws IntrospectionException Gets theBeanInfoobject which contains the information of the properties, events and methods of the specified bean class. It will not introspect the "stopclass" and its super class.Introspector will cache the BeanInfoobject. Subsequent calls to this method will be answered with the cached data.- Parameters:
- beanClass- the specified beanClass.
- stopClass- the sopt class which should be super class of the bean class. May be null.
- Returns:
- the BeanInfoof the bean class.
- Throws:
- IntrospectionException
 - 
getBeanInfopublic static BeanInfo getBeanInfo(java.lang.Class<?> beanClass, int flags) throws IntrospectionException Gets theBeanInfoobject which contains the information of the properties, events and methods of the specified bean class.- flag==IGNORE_ALL_BEANINFO, the
 
- Parameters:
- beanClass- the specified bean class.
- flags- the flag to control the usage of the explicit- BeanInfoclass.
- Returns:
- the BeanInfoof the bean class.
- Throws:
- IntrospectionException
- 
getBeanInfoSearchPathpublic static java.lang.String[] getBeanInfoSearchPath() Gets an array of search packages.- Returns:
- an array of search packages.
 
- 
setBeanInfoSearchPathpublic static void setBeanInfoSearchPath(java.lang.String[] path) Sets the search packages.- Parameters:
- path- the new search packages to be set.
 
 Introspectorwill ignore allBeanInfoclass.flag==IGNORE_IMMEDIATE_BEANINFO, theIntrospectorwill ignore theBeanInfoclass of the current bean class.flag==USE_ALL_BEANINFO, theIntrospectorwill use allBeanInfoclass which have been found.Introspector will cache theBeanInfoobject. Subsequent calls to this method will be answered with the cached data.
 
 
 
 
- 
 
- 
 
-