|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.expr.ExprRuntime
public abstract class ExprRuntime
This is an abstract class with static methods that define runtime caching information in AribaExpr.
Field Summary | |
---|---|
static int |
INDEXED_PROPERTY_INT
JavaBeans IndexedProperty |
static int |
INDEXED_PROPERTY_NONE
Not an indexed property |
static int |
INDEXED_PROPERTY_OBJECT
AribaExpr 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
|
static java.util.List |
NotFoundList
|
static java.util.Map |
NotFoundMap
|
static java.lang.String |
NULL_DISPLY_STRING
|
static java.lang.String |
NULL_VALUE_STRING
|
Constructor Summary | |
---|---|
ExprRuntime()
|
Method Summary | |
---|---|
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 java.lang.Object |
callAppropriateMethod(ExprContext context,
java.lang.Object source,
java.lang.Object target,
java.lang.String methodName,
java.lang.reflect.Method method,
java.lang.Object[] args)
|
static java.lang.Object |
callConstructor(ExprContext context,
java.lang.String className,
java.lang.Object[] args)
|
static java.lang.Object |
callMethod(ExprContext context,
java.lang.Object target,
java.lang.String methodName,
java.lang.String propertyName,
java.lang.Object[] args)
|
static java.lang.Object |
callStaticMethod(ExprContext context,
java.lang.String className,
java.lang.String methodName,
java.lang.Object[] args)
|
static boolean |
canArgsWideningTo(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 |
canWideningTo(java.lang.Object object,
java.lang.Class c)
Tells whether the given object's type can be widen to the given class ---that is, whether the given object can be passed as an argument to a method or constructor with type widdening conversion. |
static java.lang.Class |
classForName(ExprContext context,
java.lang.String className)
|
static java.lang.Object |
convert(java.lang.Object source)
|
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 |
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 java.util.List |
getConstructors(java.lang.Class targetClass)
|
static java.lang.reflect.Constructor |
getConvertedConstructorAndArgs(ExprContext context,
java.lang.Object target,
java.util.List constructors,
java.lang.Object[] args,
java.lang.Object[] newArgs)
|
static java.lang.reflect.Method |
getConvertedMethodAndArgs(ExprContext 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(ExprContext 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(ExprContext 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 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(ExprContext context,
java.lang.Object target,
java.lang.String propertyName)
|
static java.lang.Object |
getFieldValue(ExprContext context,
java.lang.Object target,
java.lang.String propertyName,
boolean checkAccessAndExistence)
|
static java.lang.reflect.Method |
getGetMethod(ExprContext context,
java.lang.Class targetClass,
java.lang.String propertyName)
|
static java.lang.Object |
getIndexedProperty(ExprContext context,
java.lang.Object source,
java.lang.String name,
java.lang.Object index)
|
static int |
getIndexedPropertyType(ExprContext context,
java.lang.Class sourceClass,
java.lang.String name)
Determines the index property type, if any. |
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(ExprContext context,
java.lang.Object target,
java.lang.String propertyName)
|
static java.lang.Object |
getMethodValue(ExprContext 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 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.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.SecurityManager |
getSecurityManager()
Gets the SecurityManager that AribaExpr uses to determine permissions for invoking methods. |
static java.lang.reflect.Method |
getSetMethod(ExprContext context,
java.lang.Class targetClass,
java.lang.String propertyName)
|
static java.lang.Object |
getStaticField(ExprContext 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 boolean |
hasField(ExprContext context,
java.lang.Object target,
java.lang.Class inClass,
java.lang.String propertyName)
|
static boolean |
hasGetMethod(ExprContext context,
java.lang.Object target,
java.lang.Class targetClass,
java.lang.String propertyName)
|
static boolean |
hasGetProperty(ExprContext context,
java.lang.Object target,
java.lang.Object oname)
|
static boolean |
hasSetMethod(ExprContext context,
java.lang.Object target,
java.lang.Class targetClass,
java.lang.String propertyName)
|
static boolean |
hasSetProperty(ExprContext 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 |
isFieldAccessible(ExprContext context,
java.lang.Object target,
java.lang.Class inClass,
java.lang.String propertyName)
|
static boolean |
isFieldAccessible(ExprContext context,
java.lang.Object target,
java.lang.reflect.Field field,
java.lang.String propertyName)
|
static boolean |
isInstance(ExprContext context,
java.lang.Object value,
java.lang.String className)
|
static boolean |
isMethodAccessible(ExprContext 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 boolean |
setFieldValue(ExprContext context,
java.lang.Object target,
java.lang.String propertyName,
java.lang.Object value)
|
static void |
setIndexedProperty(ExprContext 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(ExprContext context,
java.lang.Object target,
java.lang.String propertyName,
java.lang.Object value)
|
static boolean |
setMethodValue(ExprContext 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 |
setSecurityManager(java.lang.SecurityManager value)
Sets the SecurityManager that AribaExpr uses to determine permissions for invoking methods. |
static void |
setStaticField(ExprContext context,
java.lang.String className,
java.lang.String fieldName,
java.lang.Object value)
|
static java.lang.Object[] |
toArray(java.util.List list)
Utility to convert a List into an Object[] array. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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_DISPLY_STRING
public static final java.lang.String NULL_VALUE_STRING
Constructor Detail |
---|
public ExprRuntime()
Method Detail |
---|
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[] 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 method
public static final boolean canWideningTo(java.lang.Object object, java.lang.Class c)
public static final boolean canArgsWideningTo(java.lang.Object[] args, java.lang.Class[] classes)
public static final boolean isTypeCompatible(java.lang.Object object, java.lang.Class c)
public static final boolean areArgsCompatible(java.lang.Object[] args, java.lang.Class[] classes)
public static final boolean isMoreSpecific(java.lang.Class[] classes1, java.lang.Class[] classes2)
public static final java.lang.String getModifierString(int modifiers)
public static final java.lang.Class classForName(ExprContext context, java.lang.String className) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public static final boolean isInstance(ExprContext context, java.lang.Object value, java.lang.String className) throws ExprException
ExprException
public static java.lang.Object getPrimitiveDefaultValue(java.lang.Class forClass)
public static java.lang.Object getConvertedType(ExprContext 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(ExprContext 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(ExprContext 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(ExprContext context, java.lang.Object target, java.util.List constructors, java.lang.Object[] args, java.lang.Object[] newArgs)
public static java.lang.Object callAppropriateMethod(ExprContext context, java.lang.Object source, java.lang.Object target, java.lang.String methodName, java.lang.reflect.Method method, java.lang.Object[] args) throws MethodFailedException
MethodFailedException
public static final java.lang.Object callStaticMethod(ExprContext context, java.lang.String className, java.lang.String methodName, java.lang.Object[] args) throws ExprException, MethodFailedException
ExprException
MethodFailedException
public static final java.lang.Object callMethod(ExprContext context, java.lang.Object target, java.lang.String methodName, java.lang.String propertyName, java.lang.Object[] args) throws ExprException, MethodFailedException
ExprException
MethodFailedException
public static final java.lang.Object callConstructor(ExprContext context, java.lang.String className, java.lang.Object[] args) throws ExprException
ExprException
public static final java.lang.Object getMethodValue(ExprContext context, java.lang.Object target, java.lang.String propertyName) throws ExprException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException, java.beans.IntrospectionException
ExprException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.beans.IntrospectionException
public static final java.lang.Object getMethodValue(ExprContext context, java.lang.Object target, java.lang.String propertyName, boolean checkAccessAndExistence) throws ExprException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException, java.beans.IntrospectionException
ExprException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.beans.IntrospectionException
public static final boolean setMethodValue(ExprContext context, java.lang.Object target, java.lang.String propertyName, java.lang.Object value) throws ExprException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException, MethodFailedException, java.beans.IntrospectionException
ExprException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
MethodFailedException
java.beans.IntrospectionException
public static final boolean setMethodValue(ExprContext context, java.lang.Object target, java.lang.String propertyName, java.lang.Object value, boolean checkAccessAndExistence) throws ExprException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException, MethodFailedException, java.beans.IntrospectionException
ExprException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
MethodFailedException
java.beans.IntrospectionException
public static final java.util.List getConstructors(java.lang.Class targetClass)
public static final java.util.Map getMethods(java.lang.Class targetClass, boolean staticMethods)
public static final java.util.List getMethods(java.lang.Class targetClass, java.lang.String name, boolean staticMethods)
public static final java.util.Map getFields(java.lang.Class targetClass)
public static final java.lang.reflect.Field getField(java.lang.Class inClass, java.lang.String name)
public static final java.lang.Object getFieldValue(ExprContext context, java.lang.Object target, java.lang.String propertyName) throws java.lang.NoSuchFieldException
java.lang.NoSuchFieldException
public static final java.lang.Object getFieldValue(ExprContext context, java.lang.Object target, java.lang.String propertyName, boolean checkAccessAndExistence) throws java.lang.NoSuchFieldException
java.lang.NoSuchFieldException
public static final boolean setFieldValue(ExprContext context, java.lang.Object target, java.lang.String propertyName, java.lang.Object value) throws ExprException
ExprException
public static final boolean isFieldAccessible(ExprContext context, java.lang.Object target, java.lang.Class inClass, java.lang.String propertyName)
public static final boolean isFieldAccessible(ExprContext context, java.lang.Object target, java.lang.reflect.Field field, java.lang.String propertyName)
public static final boolean hasField(ExprContext context, java.lang.Object target, java.lang.Class inClass, java.lang.String propertyName)
public static final void setStaticField(ExprContext context, java.lang.String className, java.lang.String fieldName, java.lang.Object value) throws ExprException
ExprException
public static final java.lang.Object getStaticField(ExprContext context, java.lang.String className, java.lang.String fieldName) throws ExprException
ExprException
public static final java.util.List getDeclaredMethods(java.lang.Class targetClass, java.lang.String propertyName, boolean findSets)
public static final java.lang.reflect.Method getGetMethod(ExprContext context, java.lang.Class targetClass, java.lang.String propertyName) throws java.beans.IntrospectionException, ExprException
java.beans.IntrospectionException
ExprException
public static final boolean isMethodAccessible(ExprContext context, java.lang.Object target, java.lang.reflect.Method method, java.lang.String propertyName)
public static final boolean hasGetMethod(ExprContext context, java.lang.Object target, java.lang.Class targetClass, java.lang.String propertyName) throws java.beans.IntrospectionException, ExprException
java.beans.IntrospectionException
ExprException
public static final java.lang.reflect.Method getSetMethod(ExprContext context, java.lang.Class targetClass, java.lang.String propertyName) throws java.beans.IntrospectionException, ExprException
java.beans.IntrospectionException
ExprException
public static final boolean hasSetMethod(ExprContext context, java.lang.Object target, java.lang.Class targetClass, java.lang.String propertyName) throws java.beans.IntrospectionException, ExprException
java.beans.IntrospectionException
ExprException
public static final boolean hasGetProperty(ExprContext context, java.lang.Object target, java.lang.Object oname) throws java.beans.IntrospectionException, ExprException
java.beans.IntrospectionException
ExprException
public static final boolean hasSetProperty(ExprContext context, java.lang.Object target, java.lang.Object oname) throws java.beans.IntrospectionException, ExprException
java.beans.IntrospectionException
ExprException
public static final java.util.Map getPropertyDescriptors(java.lang.Class targetClass) throws java.beans.IntrospectionException, ExprException
java.beans.IntrospectionException
ExprException
public static final java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Class targetClass, java.lang.String propertyName) throws java.beans.IntrospectionException, ExprException
java.beans.IntrospectionException
ExprException
public static final java.beans.PropertyDescriptor[] getPropertyDescriptorsArray(java.lang.Class targetClass) throws java.beans.IntrospectionException
java.beans.IntrospectionException
public static final 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 property
java.beans.IntrospectionException
public static final void setMethodAccessor(java.lang.Class cls, MethodAccessor accessor)
public static final MethodAccessor getMethodAccessor(java.lang.Class cls) throws ExprException
ExprException
public static final NullHandler getNullHandler(java.lang.Class cls) throws ExprException
ExprException
public static final void setNullHandler(java.lang.Class cls, NullHandler handler)
public static final int getIndexedPropertyType(ExprContext context, java.lang.Class sourceClass, java.lang.String name) throws ExprException
INDEXED_PROPERTY_NONE
if the
property is not index-accessible as determined by AribaExpr 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 AribaExpr arbitrary object indexable (returns INDEXED_PROPERTY_OBJECT
).
ExprException
public static final java.lang.Object getIndexedProperty(ExprContext context, java.lang.Object source, java.lang.String name, java.lang.Object index) throws ExprException
ExprException
public static final void setIndexedProperty(ExprContext context, java.lang.Object source, java.lang.String name, java.lang.Object index, java.lang.Object value) throws ExprException
ExprException
public static EvaluationPool getEvaluationPool()
public static ObjectArrayPool getObjectArrayPool()
public static java.lang.Object convert(java.lang.Object source) throws ExprException
ExprException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |