Package org.apache.commons.jxpath
Class JXPathIntrospector
- java.lang.Object
-
- org.apache.commons.jxpath.JXPathIntrospector
-
public class JXPathIntrospector extends java.lang.ObjectJXPathIntrospector maintains a registry ofJXPathBeanInfoobjects for Java classes.- Version:
- $Revision: 670727 $ $Date: 2008-06-23 15:10:38 -0500 (Mon, 23 Jun 2008) $
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.HashMapbyClassprivate static java.util.HashMapbyInterface
-
Constructor Summary
Constructors Constructor Description JXPathIntrospector()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static JXPathBeanInfofindDynamicBeanInfo(java.lang.Class beanClass)Find a dynamic bean info if available for any superclasses or interfaces.private static JXPathBeanInfofindInformant(java.lang.Class beanClass)find a JXPathBeanInfo instance for the specified class.static JXPathBeanInfogetBeanInfo(java.lang.Class beanClass)Creates and registers a JXPathBeanInfo object for the supplied class.private static java.lang.Objectinstantiate(java.lang.Class sibling, java.lang.String className)Try to create an instance of a named class.static voidregisterAtomicClass(java.lang.Class beanClass)Automatically creates and registers a JXPathBeanInfo object for the specified class.static voidregisterDynamicClass(java.lang.Class beanClass, java.lang.Class dynamicPropertyHandlerClass)Automatically creates and registers aJXPathBeanInfoobject for the specified class.
-
-
-
Method Detail
-
registerAtomicClass
public static void registerAtomicClass(java.lang.Class beanClass)
Automatically creates and registers a JXPathBeanInfo object for the specified class. That object returns true to isAtomic().- Parameters:
beanClass- to register
-
registerDynamicClass
public static void registerDynamicClass(java.lang.Class beanClass, java.lang.Class dynamicPropertyHandlerClass)Automatically creates and registers aJXPathBeanInfoobject for the specified class. That object returns true toJXPathBeanInfo.isDynamic().- Parameters:
beanClass- to registerdynamicPropertyHandlerClass- to handle beanClass
-
getBeanInfo
public static JXPathBeanInfo getBeanInfo(java.lang.Class beanClass)
Creates and registers a JXPathBeanInfo object for the supplied class. If the class has already been registered, returns the registered JXPathBeanInfo object.The process of creation of JXPathBeanInfo is as follows:
- If class named
<beanClass>XBeanInfoexists, an instance of that class is allocated. - Otherwise, an instance of
JXPathBasicBeanInfois allocated.
- Parameters:
beanClass- whose info to get- Returns:
- JXPathBeanInfo
- If class named
-
findDynamicBeanInfo
private static JXPathBeanInfo findDynamicBeanInfo(java.lang.Class beanClass)
Find a dynamic bean info if available for any superclasses or interfaces.- Parameters:
beanClass- to search for- Returns:
- JXPathBeanInfo
-
findInformant
private static JXPathBeanInfo findInformant(java.lang.Class beanClass)
find a JXPathBeanInfo instance for the specified class. Similar to javax.beans property handler discovery; search for a class with "XBeanInfo" appended to beanClass.name, then check whether beanClass implements JXPathBeanInfo for itself. Invokes the default constructor for any class it finds.- Parameters:
beanClass- for which to look for an info provider- Returns:
- JXPathBeanInfo instance or null if none found
-
instantiate
private static java.lang.Object instantiate(java.lang.Class sibling, java.lang.String className) throws java.lang.ExceptionTry to create an instance of a named class. First try the classloader of "sibling", then try the system classloader.- Parameters:
sibling- ClassclassName- to instantiate- Returns:
- new Object
- Throws:
java.lang.Exception- if instantiation fails
-
-