Package net.minidev.asm
Class ASMUtil
- java.lang.Object
-
- net.minidev.asm.ASMUtil
-
public class ASMUtil extends Object
ASM Utils used to simplify class generation- Author:
- uriel Chemouni
-
-
Constructor Summary
Constructors Constructor Description ASMUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidautoBoxing(org.objectweb.asm.MethodVisitor mv, Class<?> clz)Append the call of proper autoboxing method for the given primitif type.protected static voidautoBoxing(org.objectweb.asm.MethodVisitor mv, org.objectweb.asm.Type fieldType)Append the call of proper autoboxing method for the given primitif type.protected static voidautoUnBoxing1(org.objectweb.asm.MethodVisitor mv, org.objectweb.asm.Type fieldType)Append the call of proper extract primitive type of an boxed object.protected static voidautoUnBoxing2(org.objectweb.asm.MethodVisitor mv, org.objectweb.asm.Type fieldType)Append the call of proper extract primitive type of an boxed object.static Accessor[]getAccessors(Class<?> type, FieldFilter filter)Extract all Accessor for the field of the given class.static StringgetGetterName(String key)static StringgetIsName(String key)static StringgetSetterName(String key)static org.objectweb.asm.Label[]newLabels(int cnt)return a array of new Label (used for switch/case generation)
-
-
-
Method Detail
-
autoBoxing
public static void autoBoxing(org.objectweb.asm.MethodVisitor mv, Class<?> clz)Append the call of proper autoboxing method for the given primitif type.
-
getAccessors
public static Accessor[] getAccessors(Class<?> type, FieldFilter filter)
Extract all Accessor for the field of the given class.- Parameters:
type-- Returns:
- all Accessor available
-
autoBoxing
protected static void autoBoxing(org.objectweb.asm.MethodVisitor mv, org.objectweb.asm.Type fieldType)Append the call of proper autoboxing method for the given primitif type.
-
autoUnBoxing1
protected static void autoUnBoxing1(org.objectweb.asm.MethodVisitor mv, org.objectweb.asm.Type fieldType)Append the call of proper extract primitive type of an boxed object.
-
autoUnBoxing2
protected static void autoUnBoxing2(org.objectweb.asm.MethodVisitor mv, org.objectweb.asm.Type fieldType)Append the call of proper extract primitive type of an boxed object. this methode use Number interface to unbox object
-
newLabels
public static org.objectweb.asm.Label[] newLabels(int cnt)
return a array of new Label (used for switch/case generation)- Parameters:
cnt- number of label to return
-
-