Package net.minidev.asm
Class BeansAccessBuilder
java.lang.Object
net.minidev.asm.BeansAccessBuilder
A builder class for dynamically creating
BeansAccess classes for accessing bean
properties efficiently. This class utilizes the ASM library to generate bytecode at runtime,
thereby bypassing the need for Java reflection.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBeansAccessBuilder(Class<?> type, Accessor[] accs, DynamicClassLoader loader) Initializes a new builder instance for a given bean class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConversion(Class<?> conv) Resister a new conversionvoidaddConversion(Iterable<Class<?>> conv) register multiple new conversionClass<?> bulid()build the conversion class.private voidDump Generate Codeprivate voidifNotEqJmp(org.objectweb.asm.MethodVisitor mv, int param, int value, org.objectweb.asm.Label label) dump a Jump if not EQprivate voidinternalSetFiled(org.objectweb.asm.MethodVisitor mv, Accessor acc) Dump Set Field Codeprivate voidthrowExIntParam(org.objectweb.asm.MethodVisitor mv, Class<?> exCls) add Throws statement with int param 2private voidthrowExStrParam(org.objectweb.asm.MethodVisitor mv, Class<?> exCls) add Throws statement with String param 2
-
Field Details
-
METHOD_ACCESS_NAME
-
type
-
accs
-
loader
-
className
-
accessClassName
-
accessClassNameInternal
-
classNameInternal
-
convMtds
-
exceptionClass
-
-
Constructor Details
-
BeansAccessBuilder
Initializes a new builder instance for a given bean class.- Parameters:
type- type to be accessaccs- used accessorloader- Loader used to store the generated class
-
-
Method Details
-
addConversion
register multiple new conversion- Parameters:
conv- conv list
-
addConversion
Resister a new conversion- Parameters:
conv- the conv
-
bulid
build the conversion class.- Returns:
- the new Class
-
dumpDebug
Dump Generate Code -
internalSetFiled
Dump Set Field Code- Parameters:
mv-acc-
-
throwExIntParam
add Throws statement with int param 2 -
throwExStrParam
add Throws statement with String param 2 -
ifNotEqJmp
private void ifNotEqJmp(org.objectweb.asm.MethodVisitor mv, int param, int value, org.objectweb.asm.Label label) dump a Jump if not EQ
-