public final class IntrospectionUtils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
IntrospectionUtils.PropertySource |
static interface |
IntrospectionUtils.SecurePropertySource |
| Constructor and Description |
|---|
IntrospectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
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) |
static java.lang.Object |
callMethodN(java.lang.Object target,
java.lang.String methodN,
java.lang.Object[] params,
java.lang.Class<?>[] typeParams) |
static java.lang.String |
capitalize(java.lang.String name)
Reverse of Introspector.decapitalize.
|
static void |
clear() |
static java.lang.Object |
convert(java.lang.String object,
java.lang.Class<?> paramType) |
static java.lang.String |
escape(java.lang.String s) |
static java.lang.reflect.Method |
findMethod(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.Object |
getProperty(java.lang.Object o,
java.lang.String name) |
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.
|
static java.lang.String |
replaceProperties(java.lang.String value,
java.util.Hashtable<java.lang.Object,java.lang.Object> staticProp,
IntrospectionUtils.PropertySource[] dynamicProp)
|
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.
|
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).
|
static boolean |
setProperty(java.lang.Object o,
java.lang.String name,
java.lang.String value,
boolean invokeSetProperty) |
static boolean |
setProperty(java.lang.Object o,
java.lang.String name,
java.lang.String value,
boolean invokeSetProperty,
java.lang.StringBuilder actualMethod) |
public static boolean setProperty(java.lang.Object o,
java.lang.String name,
java.lang.String value)
o - The object to set a property onname - The property namevalue - The property valuetrue if operation was successfulpublic static boolean setProperty(java.lang.Object o,
java.lang.String name,
java.lang.String value,
boolean invokeSetProperty)
public static boolean setProperty(java.lang.Object o,
java.lang.String name,
java.lang.String value,
boolean invokeSetProperty,
java.lang.StringBuilder actualMethod)
public static java.lang.String escape(java.lang.String s)
s - the input stringpublic static java.lang.Object getProperty(java.lang.Object o,
java.lang.String name)
@Deprecated
public static java.lang.String replaceProperties(java.lang.String value,
java.util.Hashtable<java.lang.Object,java.lang.Object> staticProp,
IntrospectionUtils.PropertySource[] dynamicProp)
value - The valuestaticProp - Replacement propertiesdynamicProp - Replacement propertiespublic 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)
value - The valuestaticProp - Replacement propertiesdynamicProp - Replacement propertiesclassLoader - Class loader associated with the code requesting the
propertypublic static java.lang.String capitalize(java.lang.String name)
name - The namepublic static void clear()
public static java.lang.reflect.Method[] findMethods(java.lang.Class<?> c)
public static java.lang.reflect.Method findMethod(java.lang.Class<?> c,
java.lang.String name,
java.lang.Class<?>[] params)
public 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
java.lang.Exceptionpublic 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
java.lang.Exceptionpublic static java.lang.Object convert(java.lang.String object,
java.lang.Class<?> paramType)
public static boolean isInstance(java.lang.Class<?> clazz,
java.lang.String type)
clazz, all its superclasses,
interfaces and those superinterfaces are tested for a match against
the type name type.
This is similar to instanceof or Class.isAssignableFrom(java.lang.Class<?>)
except that the target type will not be resolved into a Class
object, which provides some security and memory benefits.clazz - The class to test for a match.type - The name of the type that clazz must be.true if the clazz tested is an
instance of the specified type,
false otherwise.Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.