public final class IntrospectionUtils
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static interface |
IntrospectionUtils.PropertySource |
Constructor | Description |
---|---|
IntrospectionUtils() |
Modifier and Type | Method | 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.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) |
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) |
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 java.lang.Object getProperty(java.lang.Object o, java.lang.String name)
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 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.Exception
public 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.Exception
public 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-2019 Apache Software Foundation. All Rights Reserved.