public class OgnlRuntime extends Object
OgnlExpressionCompiler.TypeConverter / OgnlExpressionCompiler /
NullHandler instances / etc.. | Modifier and Type | Class and Description |
|---|---|
static class |
OgnlRuntime.ArgsCompatbilityReport
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.
|
| Modifier and Type | Field and 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 OgnlRuntime.ArgsCompatbilityReport |
NoArgsReport |
static Object[] |
NoArguments |
static Class[] |
NoArgumentTypes |
static Object |
NoConversionPossible
Token returned by TypeConverter for no conversion possible
|
static Object |
NotFound
Constant expression used to indicate that a given method / property couldn't be found
during reflection operations.
|
static List |
NotFoundList |
static Map |
NotFoundMap |
static String |
NULL_STRING
Constant string representation of null string.
|
| Constructor and Description |
|---|
OgnlRuntime() |
| Modifier and Type | Method and Description |
|---|---|
static OgnlRuntime.ArgsCompatbilityReport |
areArgsCompatible(Class[] args,
Class[] classes,
Method m) |
static boolean |
areArgsCompatible(Object[] args,
Class[] classes) |
static Object |
callAppropriateMethod(OgnlContext context,
Object source,
Object target,
String methodName,
String propertyName,
List methods,
Object[] args) |
static Object |
callConstructor(OgnlContext context,
String className,
Object[] args) |
static Object |
callMethod(OgnlContext context,
Object target,
String methodName,
Object[] args)
Invokes the specified method against the target object.
|
static Object |
callMethod(OgnlContext context,
Object target,
String methodName,
String propertyName,
Object[] args)
Deprecated.
Use
callMethod(OgnlContext, Object, String, Object[]) instead. |
static Object |
callStaticMethod(OgnlContext context,
String className,
String methodName,
Object[] args) |
static Class |
classForName(OgnlContext context,
String className) |
static void |
clearAdditionalCache()
Clears some additional caches used by OgnlRuntime.
|
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,
Object root) |
static Class[] |
findParameterTypes(Class type,
Method m)
|
static Map |
getAllMethods(Class targetClass,
boolean staticMethods) |
static List |
getAllMethods(Class targetClass,
String name,
boolean staticMethods) |
static Method |
getAppropriateMethod(OgnlContext context,
Object source,
Object target,
String propertyName,
String methodName,
List methods,
Object[] args,
Object[] actualArgs)
Gets the appropriate method to be called for the given target, method name and arguments.
|
static Class |
getArgClass(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 Class[] |
getArgClasses(Object[] args) |
static String |
getBaseName(Object o)
Returns the base name (the class name without the package name prepended) of the object
given.
|
static String |
getChildSource(OgnlContext context,
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 String |
getChildSource(OgnlContext context,
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 String |
getClassBaseName(Class c)
Returns the base name (the class name without the package name prepended) of the class given.
|
static String |
getClassName(Class c,
boolean fullyQualified) |
static String |
getClassName(Object o,
boolean fullyQualified) |
static String |
getClassPackageName(Class c)
Returns the package name of the class given.
|
static OgnlExpressionCompiler |
getCompiler() |
static List |
getConstructors(Class targetClass) |
static Constructor |
getConvertedConstructorAndArgs(OgnlContext context,
Object target,
List constructors,
Object[] args,
Object[] newArgs) |
static Method |
getConvertedMethodAndArgs(OgnlContext context,
Object target,
String propertyName,
List methods,
Object[] args,
Object[] newArgs) |
static Object |
getConvertedType(OgnlContext context,
Object target,
Member member,
String propertyName,
Object value,
Class type) |
static boolean |
getConvertedTypes(OgnlContext context,
Object target,
Member member,
String propertyName,
Class[] parameterTypes,
Object[] args,
Object[] newArgs) |
static List |
getDeclaredMethods(Class targetClass,
String propertyName,
boolean findSets) |
static boolean |
getDisableOgnlSecurityManagerOnInitValue()
Returns the value of the flag indicating whether the OGNL SecurityManager was disabled
on initialization or not.
|
static ElementsAccessor |
getElementsAccessor(Class cls) |
static EvaluationPool |
getEvaluationPool() |
static Field |
getField(Class inClass,
String name) |
static Map |
getFields(Class targetClass) |
static Object |
getFieldValue(OgnlContext context,
Object target,
String propertyName)
Deprecated.
|
static Object |
getFieldValue(OgnlContext context,
Object target,
String propertyName,
boolean checkAccessAndExistence) |
static Method |
getGetMethod(OgnlContext context,
Class targetClass,
String propertyName)
cache get methods
|
static Object |
getIndexedProperty(OgnlContext context,
Object source,
String name,
Object index) |
static int |
getIndexedPropertyType(OgnlContext context,
Class sourceClass,
String name)
Determines the index property type, if any.
|
static int |
getMajorJavaVersion()
Get the Major Java Version detected by OGNL.
|
static Method |
getMethod(OgnlContext context,
Class target,
String name,
Node[] children,
boolean includeStatic) |
static MethodAccessor |
getMethodAccessor(Class cls) |
static Map |
getMethods(Class targetClass,
boolean staticMethods) |
static List |
getMethods(Class targetClass,
String name,
boolean staticMethods) |
static Object |
getMethodValue(OgnlContext context,
Object target,
String propertyName)
Deprecated.
|
static Object |
getMethodValue(OgnlContext context,
Object target,
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 String |
getModifierString(int modifiers) |
static NullHandler |
getNullHandler(Class cls) |
static String |
getNumericCast(Class type) |
static Object |
getNumericDefaultValue(Class forClass) |
static String |
getNumericLiteral(Class type) |
static String |
getNumericValueGetter(Class type) |
static ObjectArrayPool |
getObjectArrayPool() |
static String |
getPackageName(Object o)
Returns the package name of the object's class.
|
static Class[] |
getParameterTypes(Constructor c)
Returns the parameter types of the given method.
|
static Class[] |
getParameterTypes(Method m)
Returns the parameter types of the given method.
|
static Permission |
getPermission(Method method)
Permission will be named "invoke.<declaring-class>.<method-name>".
|
static String |
getPointerString(int num)
Returns a "pointer" string in the usual format for these things - 0x<hex digits>.
|
static String |
getPointerString(Object o)
Returns a "pointer" string in the usual format for these things - 0x<hex digits> for the
object given.
|
static Object |
getPrimitiveDefaultValue(Class forClass) |
static Class |
getPrimitiveWrapperClass(Class primitiveClass) |
static PropertyDescriptor |
getProperty(Class target,
String name) |
static Object |
getProperty(OgnlContext context,
Object source,
Object name) |
static PropertyAccessor |
getPropertyAccessor(Class cls) |
static PropertyDescriptor |
getPropertyDescriptor(Class targetClass,
String propertyName)
This method returns a PropertyDescriptor for the given class and property name using a Map
lookup (using getPropertyDescriptorsMap()).
|
static PropertyDescriptor |
getPropertyDescriptorFromArray(Class targetClass,
String name)
Gets the property descriptor with the given name for the target class given.
|
static Map |
getPropertyDescriptors(Class targetClass)
This method returns the property descriptors for the given class as a Map.
|
static PropertyDescriptor[] |
getPropertyDescriptorsArray(Class targetClass) |
static Method |
getReadMethod(Class target,
String name)
Finds the best possible match for a method on the specified target class with a matching
name.
|
static Method |
getReadMethod(Class target,
String name,
Class[] argClasses) |
static SecurityManager |
getSecurityManager()
Gets the SecurityManager that OGNL uses to determine permissions for invoking methods.
|
static Method |
getSetMethod(OgnlContext context,
Class targetClass,
String propertyName)
cache set methods method
|
static Object |
getStaticField(OgnlContext context,
String className,
String fieldName)
Method name is getStaticField(), but actually behaves more like "getStaticFieldValue()".
|
static Class |
getTargetClass(Object o)
Gets the "target" class of an object for looking up accessors that are registered on the
target.
|
static String |
getUniqueDescriptor(Object object)
Returns a unique descriptor string that includes the object's class' base name and a unique
integer identifier.
|
static String |
getUniqueDescriptor(Object object,
boolean fullyQualified)
Returns a unique descriptor string that includes the object's class and a unique integer
identifier.
|
static boolean |
getUseFirstMatchGetSetLookupValue()
Returns the value of the flag indicating whether the old "first match" lookup for
getters/setters is in effect or not.
|
static boolean |
getUseJDK9PlusAccessHandlerValue()
Returns the value of the flag indicating whether the JDK9+ access handler has been
been requested (it can then be used if the Major Java Version number is 9+).
|
static boolean |
getUseStricterInvocationValue()
Returns the value of the flag indicating whether "stricter" invocation is
in effect or not.
|
static Method |
getWriteMethod(Class target,
String name) |
static Method |
getWriteMethod(Class target,
String name,
Class[] argClasses) |
static boolean |
hasField(OgnlContext context,
Object target,
Class inClass,
String propertyName) |
static boolean |
hasGetMethod(OgnlContext context,
Object target,
Class targetClass,
String propertyName) |
static boolean |
hasGetProperty(OgnlContext context,
Object target,
Object oname) |
static boolean |
hasSetMethod(OgnlContext context,
Object target,
Class targetClass,
String propertyName) |
static boolean |
hasSetProperty(OgnlContext context,
Object target,
Object oname) |
static Object |
invokeMethod(Object target,
Method method,
Object[] argsArray) |
static boolean |
isBoolean(String expression) |
static boolean |
isFieldAccessible(OgnlContext context,
Object target,
Class inClass,
String propertyName) |
static boolean |
isFieldAccessible(OgnlContext context,
Object target,
Field field,
String propertyName) |
static boolean |
isInstance(OgnlContext context,
Object value,
String className) |
static boolean |
isJdk9Plus()
Check if the detected Major Java Version is 9 or higher (JDK 9+).
|
static boolean |
isMethodAccessible(OgnlContext context,
Object target,
Method method,
String propertyName) |
static boolean |
isMoreSpecific(Class[] classes1,
Class[] classes2)
Tells whether the first array of classes is more specific than the second.
|
static boolean |
isTypeCompatible(Class parameterClass,
Class methodArgumentClass,
int index,
OgnlRuntime.ArgsCompatbilityReport report) |
static boolean |
isTypeCompatible(Object object,
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(Class cls,
ElementsAccessor accessor) |
static boolean |
setFieldValue(OgnlContext context,
Object target,
String propertyName,
Object value) |
static void |
setIndexedProperty(OgnlContext context,
Object source,
String name,
Object index,
Object value) |
static void |
setMethodAccessor(Class cls,
MethodAccessor accessor) |
static boolean |
setMethodValue(OgnlContext context,
Object target,
String propertyName,
Object value)
Deprecated.
|
static boolean |
setMethodValue(OgnlContext context,
Object target,
String propertyName,
Object value,
boolean checkAccessAndExistence) |
static void |
setNullHandler(Class cls,
NullHandler handler) |
static void |
setProperty(OgnlContext context,
Object target,
Object name,
Object value) |
static void |
setPropertyAccessor(Class cls,
PropertyAccessor accessor) |
static void |
setSecurityManager(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 Object[] |
toArray(List list)
Utility to convert a List into an Object[] array.
|
static boolean |
usingJDK9PlusAccessHandler()
Returns an indication as to whether the current state indicates the
JDK9+ (9 and later) access handler is being used / should be used.
|
public static final Object NotFound
public static final List NotFoundList
public static final Map NotFoundMap
public static final Object[] NoArguments
public static final Class[] NoArgumentTypes
public static final Object NoConversionPossible
public static int INDEXED_PROPERTY_NONE
public static int INDEXED_PROPERTY_INT
public static int INDEXED_PROPERTY_OBJECT
public static final String NULL_STRING
public static final OgnlRuntime.ArgsCompatbilityReport NoArgsReport
public static void clearCache()
Warning: Calling this too often can be a huge performance drain on your expressions - use with care.
public static void clearAdditionalCache()
clearCache()
clears the standard reflection-related caches, but some applications may have need to clear
the additional caches as well.
Clearing the additional caches may have greater impact than the clearCache()
method so it should only be used when the normal cache clear is insufficient.
Warning: Calling this method too often can be a huge performance drain on your expressions - use with care.
public static int getMajorJavaVersion()
public static boolean isJdk9Plus()
public static void setCompiler(OgnlExpressionCompiler compiler)
public static OgnlExpressionCompiler getCompiler()
public static void compileExpression(OgnlContext context, Node expression, Object root) throws Exception
Exceptionpublic static Class getTargetClass(Object o)
o - the Object from which to retrieve its Class.public static String getBaseName(Object o)
o - the Object from which to retrieve its base classname.public static String getClassBaseName(Class c)
c - the Class from which to retrieve its name.public static String getPackageName(Object o)
o - the Object from which to retrieve its Class package name.public static String getClassPackageName(Class c)
c - the Class from which to retrieve its package name.public static String getPointerString(int num)
num - the int to convert into a "pointer" string in hex format.public static String getPointerString(Object o)
o - the Object to convert into a "pointer" string in hex format.public static String getUniqueDescriptor(Object object, boolean fullyQualified)
object - the Object for which a unique descriptor string is desired.fullyQualified - true if the descriptor string is fully-qualified (package name), false for just the Class' base name.public static String getUniqueDescriptor(Object object)
object - the Object for which a unique descriptor string is desired.public static Object[] toArray(List list)
list - the List to convert into an Object array.public static Class[] getParameterTypes(Method m)
m - the Method whose parameter types are being queried.public static Class[] findParameterTypes(Class type, 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 Class[] getParameterTypes(Constructor c)
c - the Constructor whose parameter types are being queried.public static SecurityManager getSecurityManager()
public static void setSecurityManager(SecurityManager value)
value - SecurityManager to setpublic static Permission getPermission(Method method)
method - the Method whose Permission is being requested.public static Object invokeMethod(Object target, Method method, Object[] argsArray) throws InvocationTargetException, IllegalAccessException
public static final Class getArgClass(Object arg)
arg - an object that is being passed to a methodpublic static final boolean isTypeCompatible(Object object, Class c)
object - the Object to check for type-compatibility with Class c.c - the Class for which object's type-compatibility is being checked.public static final boolean isTypeCompatible(Class parameterClass, Class methodArgumentClass, int index, OgnlRuntime.ArgsCompatbilityReport report)
public static OgnlRuntime.ArgsCompatbilityReport areArgsCompatible(Class[] args, Class[] classes, Method m)
public static final boolean isMoreSpecific(Class[] classes1, Class[] classes2)
classes1 - the Class array being checked to see if it is "more specific" than classes2.classes2 - the Class array that classes1 is being checked against to see if classes1 is "more specific" than classes2.public static String getModifierString(int modifiers)
public static Class classForName(OgnlContext context, String className) throws ClassNotFoundException
ClassNotFoundExceptionpublic static boolean isInstance(OgnlContext context, Object value, String className) throws OgnlException
OgnlExceptionpublic static Object getConvertedType(OgnlContext context, Object target, Member member, String propertyName, Object value, Class type)
public static boolean getConvertedTypes(OgnlContext context, Object target, Member member, String propertyName, Class[] parameterTypes, Object[] args, Object[] newArgs)
public static Constructor getConvertedConstructorAndArgs(OgnlContext context, Object target, List constructors, Object[] args, Object[] newArgs)
public static Method getAppropriateMethod(OgnlContext context, Object source, Object target, String propertyName, String methodName, List methods, Object[] args, 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.methodName - Name of the method to get from known methods.methods - List of current known methods.args - Arguments originally passed in.actualArgs - Converted arguments.public static Method getConvertedMethodAndArgs(OgnlContext context, Object target, String propertyName, List methods, Object[] args, Object[] newArgs)
public static Object callAppropriateMethod(OgnlContext context, Object source, Object target, String methodName, String propertyName, List methods, Object[] args) throws MethodFailedException
MethodFailedExceptionpublic static Object callStaticMethod(OgnlContext context, String className, String methodName, Object[] args) throws OgnlException
OgnlExceptionpublic static Object callMethod(OgnlContext context, Object target, String methodName, String propertyName, 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 Object callMethod(OgnlContext context, Object target, String methodName, 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 Object callConstructor(OgnlContext context, String className, Object[] args) throws OgnlException
OgnlException@Deprecated public static final Object getMethodValue(OgnlContext context, Object target, String propertyName) throws OgnlException, IllegalAccessException, NoSuchMethodException, IntrospectionException
MemberAccess interfacecontext - the current execution context.target - the object to invoke the property name get on.propertyName - the name of the property to be retrieved from target.OgnlException - for lots of different reasons.IllegalAccessException - if access not permitted.NoSuchMethodException - if no property accessor exists.IntrospectionException - on errors using Introspector.public static final Object getMethodValue(OgnlContext context, Object target, String propertyName, boolean checkAccessAndExistence) throws OgnlException, IllegalAccessException, NoSuchMethodException, IntrospectionException
context - the current execution context.target - the object to invoke the property name get on.propertyName - the name of the property to be retrieved from target.checkAccessAndExistence - true if this method should check access levels and existence for propertyName of target, false otherwise.OgnlException - for lots of different reasons.IllegalAccessException - if access not permitted.NoSuchMethodException - if no property accessor exists.IntrospectionException - on errors using Introspector.@Deprecated public static boolean setMethodValue(OgnlContext context, Object target, String propertyName, Object value) throws OgnlException, IllegalAccessException, NoSuchMethodException, IntrospectionException
MemberAccess interfacecontext - the current execution context.target - the object to invoke the property name get on.propertyName - the name of the property to be set for target.value - the value to set for propertyName of target.OgnlException - for lots of different reasons.IllegalAccessException - if access not permitted.NoSuchMethodException - if no property accessor exists.IntrospectionException - on errors using Introspector.public static boolean setMethodValue(OgnlContext context, Object target, String propertyName, Object value, boolean checkAccessAndExistence) throws OgnlException, IllegalAccessException, NoSuchMethodException, IntrospectionException
public static List getAllMethods(Class targetClass, String name, boolean staticMethods)
@Deprecated public static Object getFieldValue(OgnlContext context, Object target, String propertyName) throws NoSuchFieldException
MemberAccess interfacecontext - the current execution context.target - the object to invoke the property name get on.propertyName - the name of the property to be set for target.NoSuchFieldException - if the field does not exist.public static Object getFieldValue(OgnlContext context, Object target, String propertyName, boolean checkAccessAndExistence) throws NoSuchFieldException
NoSuchFieldExceptionpublic static boolean setFieldValue(OgnlContext context, Object target, String propertyName, Object value) throws OgnlException
OgnlExceptionpublic static boolean isFieldAccessible(OgnlContext context, Object target, Class inClass, String propertyName)
public static boolean isFieldAccessible(OgnlContext context, Object target, Field field, String propertyName)
public static boolean hasField(OgnlContext context, Object target, Class inClass, String propertyName)
public static Object getStaticField(OgnlContext context, String className, String fieldName) throws OgnlException
Typical usage: Returns the value (not the actual Field) for the given (static) fieldName.
May return the Enum constant value for the given fieldName when className is an Enum.
May return a Class instance when the given fieldName is "class".
context - The current ognl contextclassName - The name of the class which contains the fieldfieldName - The name of the field whose value should be returnedOgnlException - for lots of different reasons.public static List getDeclaredMethods(Class targetClass, String propertyName, boolean findSets)
public static Method getGetMethod(OgnlContext context, Class targetClass, String propertyName) throws IntrospectionException, OgnlException
context - the current execution context.targetClass - the Class to invoke the property name "getter" retrieval on.propertyName - the name of the property for which a "getter" is sought.OgnlException - for lots of different reasons.IntrospectionException - on errors using Introspector.public static boolean isMethodAccessible(OgnlContext context, Object target, Method method, String propertyName)
public static boolean hasGetMethod(OgnlContext context, Object target, Class targetClass, String propertyName) throws IntrospectionException, OgnlException
IntrospectionExceptionOgnlExceptionpublic static Method getSetMethod(OgnlContext context, Class targetClass, String propertyName) throws IntrospectionException, OgnlException
context - the current execution context.targetClass - the Class to invoke the property name "setter" retrieval on.propertyName - the name of the property for which a "setter" is sought.IntrospectionException - on errors using Introspector.OgnlException - for lots of different reasons.public static final boolean hasSetMethod(OgnlContext context, Object target, Class targetClass, String propertyName) throws IntrospectionException, OgnlException
IntrospectionExceptionOgnlExceptionpublic static final boolean hasGetProperty(OgnlContext context, Object target, Object oname) throws IntrospectionException, OgnlException
IntrospectionExceptionOgnlExceptionpublic static final boolean hasSetProperty(OgnlContext context, Object target, Object oname) throws IntrospectionException, OgnlException
IntrospectionExceptionOgnlExceptionpublic static Map getPropertyDescriptors(Class targetClass) throws IntrospectionException, OgnlException
targetClass - The class to get the descriptors for.IntrospectionException - on errors using Introspector.OgnlException - On general errors.public static PropertyDescriptor getPropertyDescriptor(Class targetClass, String propertyName) throws IntrospectionException, OgnlException
targetClass - the class to get the descriptors for.propertyName - the property name of targetClass for which a Descriptor is requested.IntrospectionException - on errors using Introspector.OgnlException - On general errors.public static PropertyDescriptor[] getPropertyDescriptorsArray(Class targetClass) throws IntrospectionException
IntrospectionExceptionpublic static PropertyDescriptor getPropertyDescriptorFromArray(Class targetClass, String name) throws IntrospectionException
targetClass - Class for which property descriptor is desiredname - Name of propertyIntrospectionException - on errors using Introspector.public static void setMethodAccessor(Class cls, MethodAccessor accessor)
public static MethodAccessor getMethodAccessor(Class cls) throws OgnlException
OgnlExceptionpublic static void setPropertyAccessor(Class cls, PropertyAccessor accessor)
public static PropertyAccessor getPropertyAccessor(Class cls) throws OgnlException
OgnlExceptionpublic static ElementsAccessor getElementsAccessor(Class cls) throws OgnlException
OgnlExceptionpublic static void setElementsAccessor(Class cls, ElementsAccessor accessor)
public static NullHandler getNullHandler(Class cls) throws OgnlException
OgnlExceptionpublic static void setNullHandler(Class cls, NullHandler handler)
public static Object getProperty(OgnlContext context, Object source, Object name) throws OgnlException
OgnlExceptionpublic static void setProperty(OgnlContext context, Object target, Object name, Object value) throws OgnlException
OgnlExceptionpublic static int getIndexedPropertyType(OgnlContext context, Class sourceClass, 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).context - the current execution context.sourceClass - the Class to invoke indexed property type retrieval on.name - the name of the property for which an indexed property type is sought.INDEXED_PROPERTY_NONE if name is not an indexed property.OgnlException - for lots of different reasons.public static Object getIndexedProperty(OgnlContext context, Object source, String name, Object index) throws OgnlException
OgnlExceptionpublic static void setIndexedProperty(OgnlContext context, Object source, String name, Object index, Object value) throws OgnlException
OgnlExceptionpublic 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 Method getMethod(OgnlContext context, Class target, String name, Node[] children, boolean includeStatic) throws Exception
Exceptionpublic static Method getReadMethod(Class target, 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 PropertyDescriptor getProperty(Class target, String name)
public static boolean isBoolean(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 String getChildSource(OgnlContext context, 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 String getChildSource(OgnlContext context, 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)public static boolean getUseJDK9PlusAccessHandlerValue()
USE_JDK9PLUS_ACESS_HANDLER.public static boolean getUseStricterInvocationValue()
USE_STRICTER_INVOCATION.public static boolean getDisableOgnlSecurityManagerOnInitValue()
OGNL_SECURITY_MANAGER using
the value OGNL_SM_FORCE_DISABLE_ON_INIT.public static boolean usingJDK9PlusAccessHandler()
USE_JDK9PLUS_ACESS_HANDLER.public static boolean getUseFirstMatchGetSetLookupValue()
USE_FIRSTMATCH_GETSET_LOOKUP.Copyright © 1997–2021 OpenSymphony. All rights reserved.