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 void
addAlias
(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 Object
get field value by field indexget field value by fieldnameAccessor[]
int
Returns the index of the field accessor.getMap()
private static LinkedList
<Class<?>> getParents
(Class<?> type) abstract T
create a new targeted objectabstract void
set field value by field indexvoid
set field value by fieldnameprotected void
setAccessor
(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.
-