Package org.mvel2
Class PropertyAccessor
java.lang.Object
org.mvel2.PropertyAccessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private Object
private Object
private Class
private int
private static final Object[]
private int
private boolean
private int
private static final int
private static final Map
<Member, WeakReference<Class[]>> private static final Map
<Class, WeakHashMap<Integer, WeakReference<Object[]>>> private static final int
private boolean
private ParserContext
private char[]
private static final Map
<Class, WeakHashMap<Integer, WeakReference<Member>>> private int
private int
private Object
private VariableResolverFactory
private static final int
private static final Map
<Class, WeakHashMap<Integer, WeakReference<Member>>> -
Constructor Summary
ConstructorsConstructorDescriptionPropertyAccessor
(char[] property, int start, int offset, Object ctx, VariableResolverFactory resolver, Object thisReference, ParserContext pCtx) PropertyAccessor
(char[] property, Object ctx, VariableResolverFactory resolver, Object thisReference, ParserContext pCtx) PropertyAccessor
(String property, Object ctx) -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addMethodCache
(Class cls, Integer property, Method member) private static void
addReadCache
(Class cls, Integer property, Member member) private static void
addWriteCache
(Class cls, Integer property, Member member) private String
capture()
private static Object[]
checkMethodCache
(Class cls, Integer property) static Class[]
checkParmTypesCache
(Method member) private static Member
checkReadCache
(Class cls, Integer property) private static Member
checkWriteCache
(Class cls, Integer property) static void
private static int
createSignature
(String name, String args) private Object
get()
static Object
get
(char[] property, int offset, int end, Object ctx, VariableResolverFactory resolver, Object thisReferece, ParserContext pCtx) static Object
static Object
get
(String property, Object ctx, VariableResolverFactory resolver, Object thisReference, ParserContext pCtx) private Object
private Object
getBeanProperty
(Object ctx, String property) private Object
getBeanPropertyAO
(Object ctx, String property) private ClassLoader
private Object
getCollectionProperty
(Object ctx, String prop) Handle accessing a property embedded in a collections, map, or arrayprivate Object
getCollectionPropertyAO
(Object ctx, String prop) private Object
Find an appropriate method, execute it, and return it's response.private Object
private Object
getWithProperty
(Object ctx) private int
static void
private boolean
scanTo
(char c) private void
static void
static void
set
(Object ctx, VariableResolverFactory resolver, String property, Object value, ParserContext pCtx) protected int
trimLeft
(int pos) protected Object
Try static access of the property, and return an instance of the Field, Method of Class if successful.private void
-
Field Details
-
start
private int start -
cursor
private int cursor -
st
private int st -
property
private char[] property -
length
private int length -
end
private int end -
thisReference
-
ctx
-
curr
-
currType
-
first
private boolean first -
nullHandle
private boolean nullHandle -
variableFactory
-
pCtx
-
NORM
private static final int NORM- See Also:
-
METH
private static final int METH- See Also:
-
COL
private static final int COL- See Also:
-
WITH
private static final int WITH- See Also:
-
EMPTYARG
-
READ_PROPERTY_RESOLVER_CACHE
private static final Map<Class,WeakHashMap<Integer, READ_PROPERTY_RESOLVER_CACHEWeakReference<Member>>> -
WRITE_PROPERTY_RESOLVER_CACHE
private static final Map<Class,WeakHashMap<Integer, WRITE_PROPERTY_RESOLVER_CACHEWeakReference<Member>>> -
METHOD_RESOLVER_CACHE
-
METHOD_PARMTYPES_CACHE
-
-
Constructor Details
-
PropertyAccessor
-
PropertyAccessor
public PropertyAccessor(char[] property, Object ctx, VariableResolverFactory resolver, Object thisReference, ParserContext pCtx) -
PropertyAccessor
public PropertyAccessor(char[] property, int start, int offset, Object ctx, VariableResolverFactory resolver, Object thisReference, ParserContext pCtx)
-
-
Method Details
-
get
-
get
public static Object get(char[] property, int offset, int end, Object ctx, VariableResolverFactory resolver, Object thisReferece, ParserContext pCtx) -
get
public static Object get(String property, Object ctx, VariableResolverFactory resolver, Object thisReference, ParserContext pCtx) -
set
-
set
public static void set(Object ctx, VariableResolverFactory resolver, String property, Object value, ParserContext pCtx) -
get
-
getNormal
- Throws:
Exception
-
getAllowOverride
- Throws:
Exception
-
set
-
nextToken
private int nextToken() -
capture
-
trimLeft
protected int trimLeft(int pos) -
clearPropertyResolverCache
public static void clearPropertyResolverCache() -
reportCacheSizes
public static void reportCacheSizes() -
addReadCache
-
checkReadCache
-
addWriteCache
-
checkWriteCache
-
checkParmTypesCache
-
addMethodCache
-
checkMethodCache
-
getBeanPropertyAO
private Object getBeanPropertyAO(Object ctx, String property) throws IllegalAccessException, InvocationTargetException -
getBeanProperty
private Object getBeanProperty(Object ctx, String property) throws IllegalAccessException, InvocationTargetException -
whiteSpaceSkip
private void whiteSpaceSkip() -
scanTo
private boolean scanTo(char c) - Parameters:
c
- - character to scan to.- Returns:
- - returns true is end of statement is hit, false if the scan scar is countered.
-
getWithProperty
-
getCollectionProperty
Handle accessing a property embedded in a collections, map, or array- Parameters:
ctx
- -prop
- -- Returns:
- -
- Throws:
Exception
- -
-
getCollectionPropertyAO
- Throws:
Exception
-
getMethod
Find an appropriate method, execute it, and return it's response.- Parameters:
ctx
- -name
- -- Returns:
- -
-
createSignature
-
getClassLoader
-
tryStaticAccess
Try static access of the property, and return an instance of the Field, Method of Class if successful.- Returns:
- - Field, Method or Class instance.
-