public class OgnlRuntime
extends java.lang.Object
OgnlExpressionCompiler
.Core runtime configuration point for setting/using global TypeConverter
/ OgnlExpressionCompiler
/
NullHandler
instances / etc.. Modifier and Type | Field | Description |
---|---|---|
static int |
INDEXED_PROPERTY_INT |
JavaBeans IndexedProperty
|
static int |
INDEXED_PROPERTY_NONE |
Not an indexed property
|
static int |
INDEXED_PROPERTY_OBJECT |
OGNL ObjectIndexedProperty
|
static java.lang.Object[] |
NoArguments |
|
static java.lang.Class[] |
NoArgumentTypes |
|
static java.lang.Object |
NoConversionPossible |
Token returned by TypeConverter for no conversion possible
|
static java.lang.Object |
NotFound |
Constant expression used to indicate that a given method / property couldn't be found
during reflection operations.
|
static java.util.List |
NotFoundList |
|
static java.util.Map |
NotFoundMap |
|
static java.lang.String |
NULL_STRING |
Constant string representation of null string.
|
Constructor | Description |
---|---|
OgnlRuntime() |
Modifier and Type | Method | Description |
---|---|---|
static boolean |
areArgsCompatible(java.lang.Object[] args,
java.lang.Class[] classes) |
Tells whether the given array of objects is compatible with the given array of classes---that
is, whether the given array of objects can be passed as arguments to a method or constructor
whose parameter types are the given array of classes.
|
static boolean |
areArgsCompatible(java.lang.Object[] args,
java.lang.Class[] classes,
java.lang.reflect.Method m) |
|
static java.lang.Object |
callAppropriateMethod(OgnlContext context,
java.lang.Object source,
java.lang.Object target,
java.lang.String methodName,
java.lang.String propertyName,
java.util.List methods,
java.lang.Object[] args) |
|
static java.lang.Object |
callConstructor(OgnlContext context,
java.lang.String className,
java.lang.Object[] args) |
|
static java.lang.Object |
callMethod(OgnlContext context,
java.lang.Object target,
java.lang.String methodName,
java.lang.Object[] args) |
Invokes the specified method against the target object.
|
static java.lang.Object |
callMethod(OgnlContext context,
java.lang.Object target,
java.lang.String methodName,
java.lang.String propertyName,
java.lang.Object[] args) |
Deprecated.
Use
callMethod(OgnlContext, Object, String, Object[]) instead. |
static java.lang.Object |
callStaticMethod(OgnlContext context,
java.lang.String className,
java.lang.String methodName,
java.lang.Object[] args) |
|
static java.lang.Class |
classForName(OgnlContext context,
java.lang.String className) |
|
static void |
clearCache() |
Clears all of the cached reflection information normally used
to improve the speed of expressions that operate on the same classes
or are executed multiple times.
|
static void |
compileExpression(OgnlContext context,
Node expression,
java.lang.Object root) |
|
static java.lang.Class[] |
findParameterTypes(java.lang.Class type,
java.lang.reflect.Method m) |
Finds the appropriate parameter types for the given
Method and
Class instance of the type the method is associated with. |
static java.lang.reflect.Method |
getAppropriateMethod(OgnlContext context,
java.lang.Object source,
java.lang.Object target,
java.lang.String propertyName,
java.util.List methods,
java.lang.Object[] args,
java.lang.Object[] actualArgs) |
Gets the appropriate method to be called for the given target, method name and arguments.
|
static java.lang.Class |
getArgClass(java.lang.Object arg) |
Gets the class for a method argument that is appropriate for looking up methods by
reflection, by looking for the standard primitive wrapper classes and exchanging for them
their underlying primitive class objects.
|
static java.lang.String |
getBaseName(java.lang.Object o) |
Returns the base name (the class name without the package name prepended) of the object
given.
|
static java.lang.String |
getChildSource(OgnlContext context,
java.lang.Object target,
Node child) |
Attempts to get the java source string represented by the specific child expression
via the
JavaSource.toGetSourceString(OgnlContext,Object) interface method. |
static java.lang.String |
getChildSource(OgnlContext context,
java.lang.Object target,
Node child,
boolean forceConversion) |
Attempts to get the java source string represented by the specific child expression
via the
JavaSource.toGetSourceString(OgnlContext,Object) interface method. |
static java.lang.String |
getClassBaseName(java.lang.Class c) |
Returns the base name (the class name without the package name prepended) of the class given.
|
static java.lang.String |
getClassName(java.lang.Class c,
boolean fullyQualified) |
|
static java.lang.String |
getClassName(java.lang.Object o,
boolean fullyQualified) |
|
static java.lang.String |
getClassPackageName(java.lang.Class c) |
Returns the package name of the class given.
|
static OgnlExpressionCompiler |
getCompiler() |
|
static java.util.List |
getConstructors(java.lang.Class targetClass) |
|
static java.lang.reflect.Constructor |
getConvertedConstructorAndArgs(OgnlContext context,
java.lang.Object target,
java.util.List constructors,
java.lang.Object[] args,
java.lang.Object[] newArgs) |
|
static java.lang.reflect.Method |
getConvertedMethodAndArgs(OgnlContext context,
java.lang.Object target,
java.lang.String propertyName,
java.util.List methods,
java.lang.Object[] args,
java.lang.Object[] newArgs) |
|
static java.lang.Object |
getConvertedType(OgnlContext context,
java.lang.Object target,
java.lang.reflect.Member member,
java.lang.String propertyName,
java.lang.Object value,
java.lang.Class type) |
|
static boolean |
getConvertedTypes(OgnlContext context,
java.lang.Object target,
java.lang.reflect.Member member,
java.lang.String propertyName,
java.lang.Class[] parameterTypes,
java.lang.Object[] args,
java.lang.Object[] newArgs) |
|
static java.util.List |
getDeclaredMethods(java.lang.Class targetClass,
java.lang.String propertyName,
boolean findSets) |
|
static ElementsAccessor |
getElementsAccessor(java.lang.Class cls) |
|
static EvaluationPool |
getEvaluationPool() |
|
static java.lang.reflect.Field |
getField(java.lang.Class inClass,
java.lang.String name) |
|
static java.util.Map |
getFields(java.lang.Class targetClass) |
|
static java.lang.Object |
getFieldValue(OgnlContext context,
java.lang.Object target,
java.lang.String propertyName) |
|
static java.lang.Object |
getFieldValue(OgnlContext context,
java.lang.Object target,
java.lang.String propertyName,
boolean checkAccessAndExistence) |
|
static java.lang.reflect.Method |
getGetMethod(OgnlContext context,
java.lang.Class targetClass,
java.lang.String propertyName) |
|
static java.lang.Object |
getIndexedProperty(OgnlContext context,
java.lang.Object source,
java.lang.String name,
java.lang.Object index) |
|
static int |
getIndexedPropertyType(OgnlContext context,
java.lang.Class sourceClass,
java.lang.String name) |
Determines the index property type, if any.
|
static java.lang.reflect.Method |
getMethod(OgnlContext context,
java.lang.Class target,
java.lang.String name,
Node[] children,
boolean includeStatic) |
|
static MethodAccessor |
getMethodAccessor(java.lang.Class cls) |
|
static java.util.Map |
getMethods(java.lang.Class targetClass,
boolean staticMethods) |
|
static java.util.List |
getMethods(java.lang.Class targetClass,
java.lang.String name,
boolean staticMethods) |
|
static java.lang.Object |
getMethodValue(OgnlContext context,
java.lang.Object target,
java.lang.String propertyName) |
|
static java.lang.Object |
getMethodValue(OgnlContext context,
java.lang.Object target,
java.lang.String propertyName,
boolean checkAccessAndExistence) |
If the checkAccessAndExistence flag is true this method will check to see if the method
exists and if it is accessible according to the context's MemberAccess.
|
static java.lang.String |
getModifierString(int modifiers) |
|
static NullHandler |
getNullHandler(java.lang.Class cls) |
|
static java.lang.String |
getNumericCast(java.lang.Class type) |
|
static java.lang.Object |
getNumericDefaultValue(java.lang.Class forClass) |
|
static java.lang.String |
getNumericLiteral(java.lang.Class type) |
|
static java.lang.String |
getNumericValueGetter(java.lang.Class type) |
|
static ObjectArrayPool |
getObjectArrayPool() |
|
static java.lang.String |
getPackageName(java.lang.Object o) |
Returns the package name of the object's class.
|
static java.lang.Class[] |
getParameterTypes(java.lang.reflect.Constructor c) |
Returns the parameter types of the given method.
|
static java.lang.Class[] |
getParameterTypes(java.lang.reflect.Method m) |
Returns the parameter types of the given method.
|
static java.security.Permission |
getPermission(java.lang.reflect.Method method) |
Permission will be named "invoke.
|
static java.lang.String |
getPointerString(int num) |
Returns a "pointer" string in the usual format for these things - 0x
|
static java.lang.String |
getPointerString(java.lang.Object o) |
Returns a "pointer" string in the usual format for these things - 0x
|
static java.lang.Object |
getPrimitiveDefaultValue(java.lang.Class forClass) |
|
static java.lang.Class |
getPrimitiveWrapperClass(java.lang.Class primitiveClass) |
|
static java.beans.PropertyDescriptor |
getProperty(java.lang.Class target,
java.lang.String name) |
|
static java.lang.Object |
getProperty(OgnlContext context,
java.lang.Object source,
java.lang.Object name) |
|
static PropertyAccessor |
getPropertyAccessor(java.lang.Class cls) |
|
static java.beans.PropertyDescriptor |
getPropertyDescriptor(java.lang.Class targetClass,
java.lang.String propertyName) |
This method returns a PropertyDescriptor for the given class and property name using a Map
lookup (using getPropertyDescriptorsMap()).
|
static java.beans.PropertyDescriptor |
getPropertyDescriptorFromArray(java.lang.Class targetClass,
java.lang.String name) |
Gets the property descriptor with the given name for the target class given.
|
static java.util.Map |
getPropertyDescriptors(java.lang.Class targetClass) |
This method returns the property descriptors for the given class as a Map.
|
static java.beans.PropertyDescriptor[] |
getPropertyDescriptorsArray(java.lang.Class targetClass) |
|
static java.lang.reflect.Method |
getReadMethod(java.lang.Class target,
java.lang.String name) |
Finds the best possible match for a method on the specified target class with a matching
name.
|
static java.lang.reflect.Method |
getReadMethod(java.lang.Class target,
java.lang.String name,
int numParms) |
|
static java.lang.SecurityManager |
getSecurityManager() |
Gets the SecurityManager that OGNL uses to determine permissions for invoking methods.
|
static java.lang.reflect.Method |
getSetMethod(OgnlContext context,
java.lang.Class targetClass,
java.lang.String propertyName) |
|
static java.lang.Object |
getStaticField(OgnlContext context,
java.lang.String className,
java.lang.String fieldName) |
|
static java.lang.Class |
getTargetClass(java.lang.Object o) |
Gets the "target" class of an object for looking up accessors that are registered on the
target.
|
static java.lang.String |
getUniqueDescriptor(java.lang.Object object) |
Returns a unique descriptor string that includes the object's class' base name and a unique
integer identifier.
|
static java.lang.String |
getUniqueDescriptor(java.lang.Object object,
boolean fullyQualified) |
Returns a unique descriptor string that includes the object's class and a unique integer
identifier.
|
static java.lang.reflect.Method |
getWriteMethod(java.lang.Class target,
java.lang.String name) |
|
static java.lang.reflect.Method |
getWriteMethod(java.lang.Class target,
java.lang.String name,
int numParms) |
|
static boolean |
hasField(OgnlContext context,
java.lang.Object target,
java.lang.Class inClass,
java.lang.String propertyName) |
|
static boolean |
hasGetMethod(OgnlContext context,
java.lang.Object target,
java.lang.Class targetClass,
java.lang.String propertyName) |
|
static boolean |
hasGetProperty(OgnlContext context,
java.lang.Object target,
java.lang.Object oname) |
|
static boolean |
hasSetMethod(OgnlContext context,
java.lang.Object target,
java.lang.Class targetClass,
java.lang.String propertyName) |
|
static boolean |
hasSetProperty(OgnlContext context,
java.lang.Object target,
java.lang.Object oname) |
|
static java.lang.Object |
invokeMethod(java.lang.Object target,
java.lang.reflect.Method method,
java.lang.Object[] argsArray) |
|
static boolean |
isBoolean(java.lang.String expression) |
|
static boolean |
isFieldAccessible(OgnlContext context,
java.lang.Object target,
java.lang.Class inClass,
java.lang.String propertyName) |
|
static boolean |
isFieldAccessible(OgnlContext context,
java.lang.Object target,
java.lang.reflect.Field field,
java.lang.String propertyName) |
|
static boolean |
isInstance(OgnlContext context,
java.lang.Object value,
java.lang.String className) |
|
static boolean |
isJdk15() |
Checks if the current jvm is java language >= 1.5 compatible.
|
static boolean |
isMethodAccessible(OgnlContext context,
java.lang.Object target,
java.lang.reflect.Method method,
java.lang.String propertyName) |
|
static boolean |
isMoreSpecific(java.lang.Class[] classes1,
java.lang.Class[] classes2) |
Tells whether the first array of classes is more specific than the second.
|
static boolean |
isTypeCompatible(java.lang.Object object,
java.lang.Class c) |
Tells whether the given object is compatible with the given class ---that is, whether the
given object can be passed as an argument to a method or constructor whose parameter type is
the given class.
|
static void |
setClassCacheInspector(ClassCacheInspector inspector) |
Registers the specified
ClassCacheInspector with all class reflection based internal
caches. |
static void |
setCompiler(OgnlExpressionCompiler compiler) |
|
static void |
setElementsAccessor(java.lang.Class cls,
ElementsAccessor accessor) |
|
static boolean |
setFieldValue(OgnlContext context,
java.lang.Object target,
java.lang.String propertyName,
java.lang.Object value) |
|
static void |
setIndexedProperty(OgnlContext context,
java.lang.Object source,
java.lang.String name,
java.lang.Object index,
java.lang.Object value) |
|
static void |
setMethodAccessor(java.lang.Class cls,
MethodAccessor accessor) |
|
static boolean |
setMethodValue(OgnlContext context,
java.lang.Object target,
java.lang.String propertyName,
java.lang.Object value) |
|
static boolean |
setMethodValue(OgnlContext context,
java.lang.Object target,
java.lang.String propertyName,
java.lang.Object value,
boolean checkAccessAndExistence) |
|
static void |
setNullHandler(java.lang.Class cls,
NullHandler handler) |
|
static void |
setProperty(OgnlContext context,
java.lang.Object target,
java.lang.Object name,
java.lang.Object value) |
|
static void |
setPropertyAccessor(java.lang.Class cls,
PropertyAccessor accessor) |
|
static void |
setSecurityManager(java.lang.SecurityManager value) |
Sets the SecurityManager that OGNL uses to determine permissions for invoking methods.
|
static boolean |
shouldConvertNumericTypes(OgnlContext context) |
Compares the
OgnlContext.getCurrentType() and OgnlContext.getPreviousType() class types
on the stack to determine if a numeric expression should force object conversion. |
static java.lang.Object[] |
toArray(java.util.List list) |
Utility to convert a List into an Object[] array.
|
public static final java.lang.Object NotFound
public static final java.util.List NotFoundList
public static final java.util.Map NotFoundMap
public static final java.lang.Object[] NoArguments
public static final java.lang.Class[] NoArgumentTypes
public static final java.lang.Object NoConversionPossible
public static int INDEXED_PROPERTY_NONE
public static int INDEXED_PROPERTY_INT
public static int INDEXED_PROPERTY_OBJECT
public static final java.lang.String NULL_STRING
public static void clearCache()
Warning: Calling this too often can be a huge performance drain on your expressions - use with care.
public static boolean isJdk15()
public static java.lang.String getNumericValueGetter(java.lang.Class type)
public static java.lang.Class getPrimitiveWrapperClass(java.lang.Class primitiveClass)
public static java.lang.String getNumericCast(java.lang.Class type)
public static java.lang.String getNumericLiteral(java.lang.Class type)
public static void setCompiler(OgnlExpressionCompiler compiler)
public static OgnlExpressionCompiler getCompiler()
public static void compileExpression(OgnlContext context, Node expression, java.lang.Object root) throws java.lang.Exception
java.lang.Exception
public static java.lang.Class getTargetClass(java.lang.Object o)
public static java.lang.String getBaseName(java.lang.Object o)
public static java.lang.String getClassBaseName(java.lang.Class c)
public static java.lang.String getClassName(java.lang.Object o, boolean fullyQualified)
public static java.lang.String getClassName(java.lang.Class c, boolean fullyQualified)
public static java.lang.String getPackageName(java.lang.Object o)
public static java.lang.String getClassPackageName(java.lang.Class c)
public static java.lang.String getPointerString(int num)
public static java.lang.String getPointerString(java.lang.Object o)
public static java.lang.String getUniqueDescriptor(java.lang.Object object, boolean fullyQualified)
public static java.lang.String getUniqueDescriptor(java.lang.Object object)
public static java.lang.Object[] toArray(java.util.List list)
public static java.lang.Class[] getParameterTypes(java.lang.reflect.Method m)
public static java.lang.Class[] findParameterTypes(java.lang.Class type, java.lang.reflect.Method m)
Method
and
Class
instance of the type the method is associated with. Correctly
finds generic types if running in >= 1.5 jre as well.type
- The class type the method is being executed against.m
- The method to find types for.public static java.lang.Class[] getParameterTypes(java.lang.reflect.Constructor c)
public static java.lang.SecurityManager getSecurityManager()
public static void setSecurityManager(java.lang.SecurityManager value)
value
- SecurityManager to setpublic static java.security.Permission getPermission(java.lang.reflect.Method method)
public static java.lang.Object invokeMethod(java.lang.Object target, java.lang.reflect.Method method, java.lang.Object[] argsArray) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
public static final java.lang.Class getArgClass(java.lang.Object arg)
arg
- an object that is being passed to a methodpublic static final boolean isTypeCompatible(java.lang.Object object, java.lang.Class c)
public static boolean areArgsCompatible(java.lang.Object[] args, java.lang.Class[] classes)
public static boolean areArgsCompatible(java.lang.Object[] args, java.lang.Class[] classes, java.lang.reflect.Method m)
public static final boolean isMoreSpecific(java.lang.Class[] classes1, java.lang.Class[] classes2)
public static java.lang.String getModifierString(int modifiers)
public static java.lang.Class classForName(OgnlContext context, java.lang.String className) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public static boolean isInstance(OgnlContext context, java.lang.Object value, java.lang.String className) throws OgnlException
OgnlException
public static java.lang.Object getPrimitiveDefaultValue(java.lang.Class forClass)
public static java.lang.Object getNumericDefaultValue(java.lang.Class forClass)
public static java.lang.Object getConvertedType(OgnlContext context, java.lang.Object target, java.lang.reflect.Member member, java.lang.String propertyName, java.lang.Object value, java.lang.Class type)
public static boolean getConvertedTypes(OgnlContext context, java.lang.Object target, java.lang.reflect.Member member, java.lang.String propertyName, java.lang.Class[] parameterTypes, java.lang.Object[] args, java.lang.Object[] newArgs)
public static java.lang.reflect.Method getConvertedMethodAndArgs(OgnlContext context, java.lang.Object target, java.lang.String propertyName, java.util.List methods, java.lang.Object[] args, java.lang.Object[] newArgs)
public static java.lang.reflect.Constructor getConvertedConstructorAndArgs(OgnlContext context, java.lang.Object target, java.util.List constructors, java.lang.Object[] args, java.lang.Object[] newArgs)
public static java.lang.reflect.Method getAppropriateMethod(OgnlContext context, java.lang.Object source, java.lang.Object target, java.lang.String propertyName, java.util.List methods, java.lang.Object[] args, java.lang.Object[] actualArgs)
context
- The current execution context.source
- Target object to run against or method name.target
- Instance of object to be run against.propertyName
- Name of property to get method of.methods
- List of current known methods.args
- Arguments originally passed in.actualArgs
- Converted arguments.public static java.lang.Object callAppropriateMethod(OgnlContext context, java.lang.Object source, java.lang.Object target, java.lang.String methodName, java.lang.String propertyName, java.util.List methods, java.lang.Object[] args) throws MethodFailedException
MethodFailedException
public static java.lang.Object callStaticMethod(OgnlContext context, java.lang.String className, java.lang.String methodName, java.lang.Object[] args) throws OgnlException
OgnlException
public static java.lang.Object callMethod(OgnlContext context, java.lang.Object target, java.lang.String methodName, java.lang.String propertyName, java.lang.Object[] args) throws OgnlException
callMethod(OgnlContext, Object, String, Object[])
instead.context
- The current execution context.target
- The object to invoke the method on.methodName
- Name of the method - as in "getValue" or "add", etc..propertyName
- Name of the property to call instead?args
- Optional arguments needed for method.OgnlException
- For lots of different reasons.public static java.lang.Object callMethod(OgnlContext context, java.lang.Object target, java.lang.String methodName, java.lang.Object[] args) throws OgnlException
context
- The current execution context.target
- The object to invoke the method on.methodName
- Name of the method - as in "getValue" or "add", etc..args
- Optional arguments needed for method.OgnlException
- For lots of different reasons.public static java.lang.Object callConstructor(OgnlContext context, java.lang.String className, java.lang.Object[] args) throws OgnlException
OgnlException
public static final java.lang.Object getMethodValue(OgnlContext context, java.lang.Object target, java.lang.String propertyName) throws OgnlException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException, java.beans.IntrospectionException
OgnlException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.beans.IntrospectionException
public static final java.lang.Object getMethodValue(OgnlContext context, java.lang.Object target, java.lang.String propertyName, boolean checkAccessAndExistence) throws OgnlException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException, java.beans.IntrospectionException
OgnlException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.beans.IntrospectionException
public static boolean setMethodValue(OgnlContext context, java.lang.Object target, java.lang.String propertyName, java.lang.Object value) throws OgnlException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException, java.beans.IntrospectionException
OgnlException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.beans.IntrospectionException
public static boolean setMethodValue(OgnlContext context, java.lang.Object target, java.lang.String propertyName, java.lang.Object value, boolean checkAccessAndExistence) throws OgnlException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException, java.beans.IntrospectionException
OgnlException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.beans.IntrospectionException
public static java.util.List getConstructors(java.lang.Class targetClass)
public static java.util.Map getMethods(java.lang.Class targetClass, boolean staticMethods)
public static java.util.List getMethods(java.lang.Class targetClass, java.lang.String name, boolean staticMethods)
public static java.util.Map getFields(java.lang.Class targetClass)
public static java.lang.reflect.Field getField(java.lang.Class inClass, java.lang.String name)
public static java.lang.Object getFieldValue(OgnlContext context, java.lang.Object target, java.lang.String propertyName) throws java.lang.NoSuchFieldException
java.lang.NoSuchFieldException
public static java.lang.Object getFieldValue(OgnlContext context, java.lang.Object target, java.lang.String propertyName, boolean checkAccessAndExistence) throws java.lang.NoSuchFieldException
java.lang.NoSuchFieldException
public static boolean setFieldValue(OgnlContext context, java.lang.Object target, java.lang.String propertyName, java.lang.Object value) throws OgnlException
OgnlException
public static boolean isFieldAccessible(OgnlContext context, java.lang.Object target, java.lang.Class inClass, java.lang.String propertyName)
public static boolean isFieldAccessible(OgnlContext context, java.lang.Object target, java.lang.reflect.Field field, java.lang.String propertyName)
public static boolean hasField(OgnlContext context, java.lang.Object target, java.lang.Class inClass, java.lang.String propertyName)
public static java.lang.Object getStaticField(OgnlContext context, java.lang.String className, java.lang.String fieldName) throws OgnlException
OgnlException
public static java.util.List getDeclaredMethods(java.lang.Class targetClass, java.lang.String propertyName, boolean findSets)
public static java.lang.reflect.Method getGetMethod(OgnlContext context, java.lang.Class targetClass, java.lang.String propertyName) throws java.beans.IntrospectionException, OgnlException
java.beans.IntrospectionException
OgnlException
public static boolean isMethodAccessible(OgnlContext context, java.lang.Object target, java.lang.reflect.Method method, java.lang.String propertyName)
public static boolean hasGetMethod(OgnlContext context, java.lang.Object target, java.lang.Class targetClass, java.lang.String propertyName) throws java.beans.IntrospectionException, OgnlException
java.beans.IntrospectionException
OgnlException
public static java.lang.reflect.Method getSetMethod(OgnlContext context, java.lang.Class targetClass, java.lang.String propertyName) throws java.beans.IntrospectionException, OgnlException
java.beans.IntrospectionException
OgnlException
public static final boolean hasSetMethod(OgnlContext context, java.lang.Object target, java.lang.Class targetClass, java.lang.String propertyName) throws java.beans.IntrospectionException, OgnlException
java.beans.IntrospectionException
OgnlException
public static final boolean hasGetProperty(OgnlContext context, java.lang.Object target, java.lang.Object oname) throws java.beans.IntrospectionException, OgnlException
java.beans.IntrospectionException
OgnlException
public static final boolean hasSetProperty(OgnlContext context, java.lang.Object target, java.lang.Object oname) throws java.beans.IntrospectionException, OgnlException
java.beans.IntrospectionException
OgnlException
public static java.util.Map getPropertyDescriptors(java.lang.Class targetClass) throws java.beans.IntrospectionException, OgnlException
targetClass
- The class to get the descriptors for.java.beans.IntrospectionException
- on errors using Introspector
.OgnlException
- On general errors.public static java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Class targetClass, java.lang.String propertyName) throws java.beans.IntrospectionException, OgnlException
java.beans.IntrospectionException
OgnlException
public static java.beans.PropertyDescriptor[] getPropertyDescriptorsArray(java.lang.Class targetClass) throws java.beans.IntrospectionException
java.beans.IntrospectionException
public static java.beans.PropertyDescriptor getPropertyDescriptorFromArray(java.lang.Class targetClass, java.lang.String name) throws java.beans.IntrospectionException
targetClass
- Class for which property descriptor is desiredname
- Name of propertyjava.beans.IntrospectionException
public static void setMethodAccessor(java.lang.Class cls, MethodAccessor accessor)
public static MethodAccessor getMethodAccessor(java.lang.Class cls) throws OgnlException
OgnlException
public static void setPropertyAccessor(java.lang.Class cls, PropertyAccessor accessor)
public static PropertyAccessor getPropertyAccessor(java.lang.Class cls) throws OgnlException
OgnlException
public static ElementsAccessor getElementsAccessor(java.lang.Class cls) throws OgnlException
OgnlException
public static void setElementsAccessor(java.lang.Class cls, ElementsAccessor accessor)
public static NullHandler getNullHandler(java.lang.Class cls) throws OgnlException
OgnlException
public static void setNullHandler(java.lang.Class cls, NullHandler handler)
public static java.lang.Object getProperty(OgnlContext context, java.lang.Object source, java.lang.Object name) throws OgnlException
OgnlException
public static void setProperty(OgnlContext context, java.lang.Object target, java.lang.Object name, java.lang.Object value) throws OgnlException
OgnlException
public static int getIndexedPropertyType(OgnlContext context, java.lang.Class sourceClass, java.lang.String name) throws OgnlException
INDEXED_PROPERTY_NONE
if
the property is not index-accessible as determined by OGNL or JavaBeans. If it is indexable
then this will return whether it is a JavaBeans indexed property, conforming to the indexed
property patterns (returns INDEXED_PROPERTY_INT
) or if it conforms to the
OGNL arbitrary object indexable (returns INDEXED_PROPERTY_OBJECT
).OgnlException
public static java.lang.Object getIndexedProperty(OgnlContext context, java.lang.Object source, java.lang.String name, java.lang.Object index) throws OgnlException
OgnlException
public static void setIndexedProperty(OgnlContext context, java.lang.Object source, java.lang.String name, java.lang.Object index, java.lang.Object value) throws OgnlException
OgnlException
public static EvaluationPool getEvaluationPool()
public static ObjectArrayPool getObjectArrayPool()
public static void setClassCacheInspector(ClassCacheInspector inspector)
ClassCacheInspector
with all class reflection based internal
caches. This may have a significant performance impact so be careful using this in production scenarios.inspector
- The inspector instance that will be registered with all internal cache instances.public static java.lang.reflect.Method getMethod(OgnlContext context, java.lang.Class target, java.lang.String name, Node[] children, boolean includeStatic) throws java.lang.Exception
java.lang.Exception
public static java.lang.reflect.Method getReadMethod(java.lang.Class target, java.lang.String name)
The name matched will also try different combinations like is + name, has + name, get + name, etc..
target
- The class to find a matching method against.name
- The name of the method.Method
, or null if none could be found.public static java.lang.reflect.Method getReadMethod(java.lang.Class target, java.lang.String name, int numParms)
public static java.lang.reflect.Method getWriteMethod(java.lang.Class target, java.lang.String name)
public static java.lang.reflect.Method getWriteMethod(java.lang.Class target, java.lang.String name, int numParms)
public static java.beans.PropertyDescriptor getProperty(java.lang.Class target, java.lang.String name)
public static boolean isBoolean(java.lang.String expression)
public static boolean shouldConvertNumericTypes(OgnlContext context)
OgnlContext.getCurrentType()
and OgnlContext.getPreviousType()
class types
on the stack to determine if a numeric expression should force object conversion.
Normally used in conjunction with the forceConversion
parameter of
getChildSource(OgnlContext,Object,Node,boolean)
.
context
- The current context.o1 >= o2
.public static java.lang.String getChildSource(OgnlContext context, java.lang.Object target, Node child) throws OgnlException
JavaSource.toGetSourceString(OgnlContext,Object)
interface method.context
- The ognl context to pass to the child.target
- The current object target to use.child
- The child expression.JavaSource.toGetSourceString(OgnlContext,Object)
plus additional
enclosures of OgnlOps.convertValue(Object,Class,boolean)
for conversions.OgnlException
- Mandatory exception throwing catching.. (blehh)public static java.lang.String getChildSource(OgnlContext context, java.lang.Object target, Node child, boolean forceConversion) throws OgnlException
JavaSource.toGetSourceString(OgnlContext,Object)
interface method.context
- The ognl context to pass to the child.target
- The current object target to use.child
- The child expression.forceConversion
- If true, forces OgnlOps.convertValue(Object,Class)
conversions on the objects.JavaSource.toGetSourceString(OgnlContext,Object)
plus additional
enclosures of OgnlOps.convertValue(Object,Class,boolean)
for conversions.OgnlException
- Mandatory exception throwing catching.. (blehh)