Package org.apache.tomcat.util
Class IntrospectionUtils
- java.lang.Object
- 
- org.apache.tomcat.util.IntrospectionUtils
 
- 
 public final class IntrospectionUtils extends java.lang.ObjectUtils for introspection and reflection
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceIntrospectionUtils.PropertySourcestatic interfaceIntrospectionUtils.SecurePropertySource
 - 
Constructor SummaryConstructors Constructor Description IntrospectionUtils()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.ObjectcallMethod1(java.lang.Object target, java.lang.String methodN, java.lang.Object param1, java.lang.String typeParam1, java.lang.ClassLoader cl)static java.lang.ObjectcallMethodN(java.lang.Object target, java.lang.String methodN, java.lang.Object[] params, java.lang.Class<?>[] typeParams)static java.lang.Stringcapitalize(java.lang.String name)Reverse of Introspector.decapitalize.static voidclear()static java.lang.Objectconvert(java.lang.String object, java.lang.Class<?> paramType)static java.lang.Stringescape(java.lang.String s)static java.lang.reflect.MethodfindMethod(java.lang.Class<?> c, java.lang.String name, java.lang.Class<?>[] params)static java.lang.reflect.Method[]findMethods(java.lang.Class<?> c)static java.lang.ObjectgetProperty(java.lang.Object o, java.lang.String name)static booleanisInstance(java.lang.Class<?> clazz, java.lang.String type)Checks to see if the specified class is an instance of or assignable from the specified type.static java.lang.StringreplaceProperties(java.lang.String value, java.util.Hashtable<java.lang.Object,java.lang.Object> staticProp, IntrospectionUtils.PropertySource[] dynamicProp)static java.lang.StringreplaceProperties(java.lang.String value, java.util.Hashtable<java.lang.Object,java.lang.Object> staticProp, IntrospectionUtils.PropertySource[] dynamicProp, java.lang.ClassLoader classLoader)Replace ${NAME} with the property value.static booleansetProperty(java.lang.Object o, java.lang.String name, java.lang.String value)Find a method with the right name If found, call the method ( if param is int or boolean we'll convert value to the right type before) - that means you can have setDebug(1).static booleansetProperty(java.lang.Object o, java.lang.String name, java.lang.String value, boolean invokeSetProperty)static booleansetProperty(java.lang.Object o, java.lang.String name, java.lang.String value, boolean invokeSetProperty, java.lang.StringBuilder actualMethod)
 
- 
- 
- 
Method Detail- 
setPropertypublic static boolean setProperty(java.lang.Object o, java.lang.String name, java.lang.String value)Find a method with the right name If found, call the method ( if param is int or boolean we'll convert value to the right type before) - that means you can have setDebug(1).- Parameters:
- o- The object to set a property on
- name- The property name
- value- The property value
- Returns:
- trueif operation was successful
 
 - 
setPropertypublic static boolean setProperty(java.lang.Object o, java.lang.String name, java.lang.String value, boolean invokeSetProperty)
 - 
setPropertypublic static boolean setProperty(java.lang.Object o, java.lang.String name, java.lang.String value, boolean invokeSetProperty, java.lang.StringBuilder actualMethod)
 - 
escapepublic static java.lang.String escape(java.lang.String s) - Parameters:
- s- the input string
- Returns:
- escaped string, per Java rule
 
 - 
getPropertypublic static java.lang.Object getProperty(java.lang.Object o, java.lang.String name)
 - 
replaceProperties@Deprecated public static java.lang.String replaceProperties(java.lang.String value, java.util.Hashtable<java.lang.Object,java.lang.Object> staticProp, IntrospectionUtils.PropertySource[] dynamicProp)Replaces ${NAME} in the value with the value of the property 'NAME'. Replaces ${NAME:DEFAULT} with the value of the property 'NAME:DEFAULT', if the property 'NAME:DEFAULT' is not set, the expression is replaced with the value of the property 'NAME', if the property 'NAME' is not set, the expression is replaced with 'DEFAULT'. If the property is not set and there is no default the value will be returned unmodified.- Parameters:
- value- The value
- staticProp- Replacement properties
- dynamicProp- Replacement properties
- Returns:
- the replacement value
 
 - 
replacePropertiespublic static java.lang.String replaceProperties(java.lang.String value, java.util.Hashtable<java.lang.Object,java.lang.Object> staticProp, IntrospectionUtils.PropertySource[] dynamicProp, java.lang.ClassLoader classLoader)Replace ${NAME} with the property value.- Parameters:
- value- The value
- staticProp- Replacement properties
- dynamicProp- Replacement properties
- classLoader- Class loader associated with the code requesting the property
- Returns:
- the replacement value
 
 - 
capitalizepublic static java.lang.String capitalize(java.lang.String name) Reverse of Introspector.decapitalize.- Parameters:
- name- The name
- Returns:
- the capitalized string
 
 - 
clearpublic static void clear() 
 - 
findMethodspublic static java.lang.reflect.Method[] findMethods(java.lang.Class<?> c) 
 - 
findMethodpublic static java.lang.reflect.Method findMethod(java.lang.Class<?> c, java.lang.String name, java.lang.Class<?>[] params)
 - 
callMethod1public static java.lang.Object callMethod1(java.lang.Object target, java.lang.String methodN, java.lang.Object param1, java.lang.String typeParam1, java.lang.ClassLoader cl) throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
callMethodNpublic static java.lang.Object callMethodN(java.lang.Object target, java.lang.String methodN, java.lang.Object[] params, java.lang.Class<?>[] typeParams) throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
convertpublic static java.lang.Object convert(java.lang.String object, java.lang.Class<?> paramType)
 - 
isInstancepublic static boolean isInstance(java.lang.Class<?> clazz, java.lang.String type)Checks to see if the specified class is an instance of or assignable from the specified type. The classclazz, all its superclasses, interfaces and those superinterfaces are tested for a match against the type nametype. This is similar toinstanceoforClass.isAssignableFrom(java.lang.Class<?>)except that the target type will not be resolved into a Class object, which provides some security and memory benefits.- Parameters:
- clazz- The class to test for a match.
- type- The name of the type that- clazzmust be.
- Returns:
- trueif the- clazztested is an instance of the specified- type,- falseotherwise.
 
 
- 
 
-