Package org.apache.catalina.util
Class Introspection
- java.lang.Object
- 
- org.apache.catalina.util.Introspection
 
- 
 public class Introspection extends java.lang.ObjectProvides introspection utilities that either require knowledge of Tomcat internals or are solely used by Tomcat internals.
- 
- 
Constructor SummaryConstructors Constructor Description Introspection()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Class<?>convertPrimitiveType(java.lang.Class<?> clazz)Converts the primitive type to its corresponding wrapper.static java.lang.reflect.Field[]getDeclaredFields(java.lang.Class<?> clazz)Obtain the declared fields for a class taking account of any security manager that may be configured.static java.lang.reflect.Method[]getDeclaredMethods(java.lang.Class<?> clazz)Obtain the declared methods for a class taking account of any security manager that may be configured.static java.lang.StringgetPropertyName(java.lang.reflect.Method setter)Extract the Java Bean property name from the setter name.static booleanisValidLifecycleCallback(java.lang.reflect.Method method)Determines if a method is a valid lifecycle callback method.static booleanisValidSetter(java.lang.reflect.Method method)Determines if a method has a valid name and signature for a Java Bean setter.static java.lang.Class<?>loadClass(Context context, java.lang.String className)Attempt to load a class using the given Container's class loader.
 
- 
- 
- 
Method Detail- 
getPropertyNamepublic static java.lang.String getPropertyName(java.lang.reflect.Method setter) Extract the Java Bean property name from the setter name. Note: This method assumes that the method name has already been checked for correctness.- Parameters:
- setter- The setter method
- Returns:
- the bean property name
 
 - 
isValidSetterpublic static boolean isValidSetter(java.lang.reflect.Method method) Determines if a method has a valid name and signature for a Java Bean setter.- Parameters:
- method- The method to test
- Returns:
- trueif the method does have a valid name and signature, else- false
 
 - 
isValidLifecycleCallbackpublic static boolean isValidLifecycleCallback(java.lang.reflect.Method method) Determines if a method is a valid lifecycle callback method.- Parameters:
- method- The method to test
- Returns:
- trueif the method is a valid lifecycle callback method, else- false
 
 - 
getDeclaredFieldspublic static java.lang.reflect.Field[] getDeclaredFields(java.lang.Class<?> clazz) Obtain the declared fields for a class taking account of any security manager that may be configured.- Parameters:
- clazz- The class to introspect
- Returns:
- the class fields as an array
 
 - 
getDeclaredMethodspublic static java.lang.reflect.Method[] getDeclaredMethods(java.lang.Class<?> clazz) Obtain the declared methods for a class taking account of any security manager that may be configured.- Parameters:
- clazz- The class to introspect
- Returns:
- the class methods as an array
 
 - 
loadClasspublic static java.lang.Class<?> loadClass(Context context, java.lang.String className) Attempt to load a class using the given Container's class loader. If the class cannot be loaded, a debug level log message will be written to the Container's log and null will be returned.- Parameters:
- context- The class loader of this context will be used to attempt to load the class
- className- The class name
- Returns:
- the loaded class or nullif loading failed
 
 - 
convertPrimitiveTypepublic static java.lang.Class<?> convertPrimitiveType(java.lang.Class<?> clazz) Converts the primitive type to its corresponding wrapper.- Parameters:
- clazz- Class that will be evaluated
- Returns:
- if the parameter is a primitive type returns its wrapper; otherwise returns the same class
 
 
- 
 
-