Package net.minidev.asm
Class BeansAccess<T>
java.lang.Object
net.minidev.asm.BeansAccess<T>
Allow access reflect field using runtime generated accessor. BeansAccessor is
faster than java.lang.reflect.Method.invoke()
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Accessor[]private static ConcurrentHashMap<Class<?>, BeansAccess<?>> cache used to store built BeansAccess -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddAlias(BeansAccess<?> access, HashMap<String, String> m) static <P> BeansAccess<P> return the BeansAccess corresponding to a typestatic <P> BeansAccess<P> get(Class<P> type, FieldFilter filter) return the BeansAccess corresponding to a typeabstract Objectget field value by field indexget field value by fieldnameAccessor[]intReturns the index of the field accessor.getMap()private static LinkedList<Class<?>> getParents(Class<?> type) abstract Tcreate a new targeted objectabstract voidset field value by field indexvoidset field value by fieldnameprotected voidsetAccessor(Accessor[] accs)
-
Field Details
-
map
-
accs
-
cache
cache used to store built BeansAccess
-
-
Constructor Details
-
BeansAccess
public BeansAccess()
-
-
Method Details
-
setAccessor
-
getMap
-
getAccessors
-
get
return the BeansAccess corresponding to a type- Parameters:
type- to be access- Returns:
- the BeansAccess
-
get
return the BeansAccess corresponding to a type- Parameters:
type- to be access- Returns:
- the BeansAccess
-
getParents
-
addAlias
-
set
set field value by field index -
get
get field value by field index -
newInstance
create a new targeted object -
set
set field value by fieldname -
get
get field value by fieldname -
getIndex
Returns the index of the field accessor.
-