Class Reflector
java.lang.Object
com.googlecode.aviator.utils.Reflector
Some code is copied from
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Reflector.java
- Author:
- dennis(killme2008@gmail.com)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic ConcurrentHashMap<Class<?>, Reference<Map<String, com.googlecode.aviator.utils.Reflector.PropertyFoundResult>>> static method cachingstatic ConcurrentHashMap<Class<?>, Reference<Map<String, com.googlecode.aviator.utils.Reflector.PropertyFoundResult>>> static and instance fields property cachingstatic ConcurrentHashMap<Class<?>, Reference<Map<String, com.googlecode.aviator.utils.Reflector.PropertyFoundResult>>> instance fields setter caching. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Objectstatic Object[]static StringBuildercapitalize(StringBuilder sb, String s) static ObjectfastGetProperty(Object obj, String name, Reflector.PropertyType type) static ObjectfastGetProperty(String name, String[] names, Map<String, Object> env, Reflector.Target target, boolean tryResolveStaticMethod, int offset, int len) findMethodsFromClass(Class<?> clazz, boolean isStatic) getInstanceMethods(Class<?> clazz, String methodName) static ObjectgetProperty(Object target, String name) getStaticMethods(Class<?> c, String methodName) static ObjectinvokeInstanceMethod(Class<?> c, String methodName, Object target, List<Method> methods, Object[] args) static Objectstatic booleanisCongruent(Class<?>[] params, Object[] args) static booleanparamArgTypeMatch(Class<?> paramType, Class<?> argType) static voidstatic RuntimeExceptionThrow even checked exceptions without being required to declare them or catch them.static booleanstatic Object
-
Field Details
-
cachedProperties
public static ConcurrentHashMap<Class<?>, Reference<Map<String, com.googlecode.aviator.utils.Reflector.PropertyFoundResult>>> cachedPropertiesstatic and instance fields property caching -
cachedSettters
public static ConcurrentHashMap<Class<?>, Reference<Map<String, com.googlecode.aviator.utils.Reflector.PropertyFoundResult>>> cachedSetttersinstance fields setter caching. -
cachedMethods
public static ConcurrentHashMap<Class<?>, Reference<Map<String, com.googlecode.aviator.utils.Reflector.PropertyFoundResult>>> cachedMethodsstatic method caching
-
-
Constructor Details
-
Reflector
public Reflector()
-
-
Method Details
-
sneakyThrow
Throw even checked exceptions without being required to declare them or catch them. Suggested idiom:throw sneakyThrow( some exception ); -
subsumes
-
capitalize
-
fastGetProperty
-
throwNoSuchPropertyException
-
getStaticMethods
-
getInstanceMethods
-
invokeStaticMethod
-
invokeInstanceMethod
-
boxArg
-
boxArgs
-
paramArgTypeMatch
-
isCongruent
-
getProperty
-
setProperty
-
fastGetProperty
-
findMethodsFromClass
-