Top Inners Fields Constructors Methods
org.springframework.cglib.core

public Class EmitUtils

extends Object
Class Inheritance
Annotations
@SuppressWarnings:rawtypes, unchecked, static, fallthrough, deprecation
Imports
java.math.BigDecimal, .BigInteger, java.util.Arrays, .BitSet, .Collections, .HashMap, .HashSet, .Iterator, .List, .Map, .Set, org.springframework.asm.Label, .Type, org.springframework.cglib.core.internal.CustomizerRegistry

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
private static interface

Field Summary

Modifier and TypeField and Description
private static final Signature
private static final Signature
private static final Signature
private static final Signature
private static final Signature
private static final Signature
private static final Signature
private static final Signature
private static final Signature
public static final EmitUtils.ArrayDelimiters
private static final Signature
private static final Signature
private static final Signature
private static final Signature
private static final Signature
private static final Signature
private static final Signature
private static final Signature
private static final Signature
private static final Signature
private static final Signature
private static final Signature

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
add_properties(ClassEmitter ce, String[] names, Type[] types)

public static void
add_property(ClassEmitter ce, String name, Type type, String fieldName)

public static void
public static void
append_string(final CodeEmitter e, Type type, final EmitUtils.ArrayDelimiters delims, final CustomizerRegistry registry)

private static void
public static CodeEmitter
public static CodeEmitter
begin_method(ClassEmitter e, MethodInfo method, int access)

public static void
public static void
pack-priv static int[]
getSwitchKeys(Map<K, V> buckets)

private static void
hash_array(final CodeEmitter e, Type type, final int multiplier, final CustomizerRegistry registry)

public static void
hash_code(CodeEmitter e, Type type, int multiplier, final Customizer customizer)

public static void
hash_code(CodeEmitter e, Type type, int multiplier, final CustomizerRegistry registry)

private static void
private static void
private static void
public static void
private static void
public static void
public static void
private static void
member_helper_size(final CodeEmitter e, List<E> members, final ObjectSwitchCallback callback, final EmitUtils.ParameterTyper typer, final Label def, final Label end)

private static void
member_helper_type(final CodeEmitter e, List<E> members, final ObjectSwitchCallback callback, final EmitUtils.ParameterTyper typer, final Label def, final Label end, final BitSet checked)

private static void
member_switch_helper(final CodeEmitter e, List<E> members, final ObjectSwitchCallback callback, boolean useName)

public static void
public static void
not_equals(CodeEmitter e, Type type, final Label notEquals, final Customizer customizer)

public static void
not_equals(final CodeEmitter e, Type type, final Label notEquals, final CustomizerRegistry registry)

Branches to the specified label if the top two items on the stack are not equal.

private static void
public static void
private static void
nullcmp(CodeEmitter e, Label
label to branch to if only one of the objects is null
oneNull
,
Label
label to branch to if both of the objects are null
bothNull
)

If both objects on the top of the stack are non-null, does nothing.

public static void
process_array(CodeEmitter e, Type
the type of the array (type.isArray() must be true)
type
,
ProcessArrayCallback
the callback triggered for each element
callback
)

Process an array on the stack.

public static void
process_arrays(CodeEmitter e, Type
the type of the arrays (type.isArray() must be true)
type
,
ProcessArrayCallback
the callback triggered for each pair of elements
callback
)

Process two arrays on the stack in parallel.

public static void
public static void
private static Class<T>
remapComponentType(Class<T> componentType)

private static void
public static void
string_switch(CodeEmitter e, String[] strings, int switchStyle, ObjectSwitchCallback callback)

private static void
string_switch_hash(final CodeEmitter e, final String[] strings, final ObjectSwitchCallback callback, final boolean skipEquals)

private static void
string_switch_trie(final CodeEmitter e, String[] strings, final ObjectSwitchCallback callback)

private static void
stringSwitchHelper(final CodeEmitter e, List<E> strings, final ObjectSwitchCallback callback, final Label def, final Label end, final int index)

public static void
wrap_throwable(Block block, Type wrapper)

public static void
wrap_undeclared_throwable(CodeEmitter e, Block handler, Type[] exceptions, Type wrapper)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

APPEND_BOOLEANback to summary
private static final Signature APPEND_BOOLEAN
APPEND_CHARback to summary
private static final Signature APPEND_CHAR
APPEND_DOUBLEback to summary
private static final Signature APPEND_DOUBLE
APPEND_FLOATback to summary
private static final Signature APPEND_FLOAT
APPEND_INTback to summary
private static final Signature APPEND_INT
APPEND_LONGback to summary
private static final Signature APPEND_LONG
APPEND_STRINGback to summary
private static final Signature APPEND_STRING
CSTRUCT_NULLback to summary
private static final Signature CSTRUCT_NULL
CSTRUCT_THROWABLEback to summary
private static final Signature CSTRUCT_THROWABLE
DEFAULT_DELIMITERSback to summary
public static final EmitUtils.ArrayDelimiters DEFAULT_DELIMITERS
DOUBLE_TO_LONG_BITSback to summary
private static final Signature DOUBLE_TO_LONG_BITS
EQUALSback to summary
private static final Signature EQUALS
FLOAT_TO_INT_BITSback to summary
private static final Signature FLOAT_TO_INT_BITS
FOR_NAMEback to summary
private static final Signature FOR_NAME
GET_DECLARED_METHODback to summary
private static final Signature GET_DECLARED_METHOD
GET_NAMEback to summary
private static final Signature GET_NAME
HASH_CODEback to summary
private static final Signature HASH_CODE
LENGTHback to summary
private static final Signature LENGTH
SET_LENGTHback to summary
private static final Signature SET_LENGTH
STRING_CHAR_ATback to summary
private static final Signature STRING_CHAR_AT
STRING_LENGTHback to summary
private static final Signature STRING_LENGTH
TO_STRINGback to summary
private static final Signature TO_STRING

Constructor Detail

EmitUtilsback to summary
private EmitUtils()

Method Detail

add_propertiesback to summary
public static void add_properties(ClassEmitter ce, String[] names, Type[] types)
add_propertyback to summary
public static void add_property(ClassEmitter ce, String name, Type type, String fieldName)
append_stringback to summary
public static void append_string(final CodeEmitter e, Type type, final EmitUtils.ArrayDelimiters delims, final Customizer customizer)
Annotations
@Deprecated
append_stringback to summary
public static void append_string(final CodeEmitter e, Type type, final EmitUtils.ArrayDelimiters delims, final CustomizerRegistry registry)
append_string_helperback to summary
private static void append_string_helper(CodeEmitter e, Type type, EmitUtils.ArrayDelimiters delims, CustomizerRegistry registry, ProcessArrayCallback callback)
begin_methodback to summary
public static CodeEmitter begin_method(ClassEmitter e, MethodInfo method)
begin_methodback to summary
public static CodeEmitter begin_method(ClassEmitter e, MethodInfo method, int access)
constructor_switchback to summary
public static void constructor_switch(CodeEmitter e, List<E> constructors, ObjectSwitchCallback callback)
factory_methodback to summary
public static void factory_method(ClassEmitter ce, Signature sig)
getSwitchKeysback to summary
pack-priv static int[] getSwitchKeys(Map<K, V> buckets)
hash_arrayback to summary
private static void hash_array(final CodeEmitter e, Type type, final int multiplier, final CustomizerRegistry registry)
hash_codeback to summary
public static void hash_code(CodeEmitter e, Type type, int multiplier, final Customizer customizer)
Annotations
@Deprecated
hash_codeback to summary
public static void hash_code(CodeEmitter e, Type type, int multiplier, final CustomizerRegistry registry)
hash_longback to summary
private static void hash_long(CodeEmitter e)
hash_objectback to summary
private static void hash_object(CodeEmitter e, Type type, CustomizerRegistry registry)
hash_primitiveback to summary
private static void hash_primitive(CodeEmitter e, Type type)
load_classback to summary
public static void load_class(CodeEmitter e, Type type)
load_class_helperback to summary
private static void load_class_helper(CodeEmitter e, final Type type)
load_class_thisback to summary
public static void load_class_this(CodeEmitter e)
load_methodback to summary
public static void load_method(CodeEmitter e, MethodInfo method)
member_helper_sizeback to summary
private static void member_helper_size(final CodeEmitter e, List<E> members, final ObjectSwitchCallback callback, final EmitUtils.ParameterTyper typer, final Label def, final Label end) throws Exception
member_helper_typeback to summary
private static void member_helper_type(final CodeEmitter e, List<E> members, final ObjectSwitchCallback callback, final EmitUtils.ParameterTyper typer, final Label def, final Label end, final BitSet checked) throws Exception
member_switch_helperback to summary
private static void member_switch_helper(final CodeEmitter e, List<E> members, final ObjectSwitchCallback callback, boolean useName)
method_switchback to summary
public static void method_switch(CodeEmitter e, List<E> methods, ObjectSwitchCallback callback)
not_equalsback to summary
public static void not_equals(CodeEmitter e, Type type, final Label notEquals, final Customizer customizer)
Annotations
@Deprecated
not_equalsback to summary
public static void not_equals(final CodeEmitter e, Type type, final Label notEquals, final CustomizerRegistry registry)

Branches to the specified label if the top two items on the stack are not equal. The items must both be of the specified class. Equality is determined by comparing primitive values directly and by invoking the equals method for Objects. Arrays are recursively processed in the same manner.

not_equals_helperback to summary
private static void not_equals_helper(CodeEmitter e, Type type, Label notEquals, CustomizerRegistry registry, ProcessArrayCallback callback)
null_constructorback to summary
public static void null_constructor(ClassEmitter ce)
nullcmpback to summary
private static void nullcmp(CodeEmitter e, Label oneNull, Label bothNull)

If both objects on the top of the stack are non-null, does nothing. If one is null, or both are null, both are popped off and execution branches to the respective label.

Parameters
oneNull:Label

label to branch to if only one of the objects is null

bothNull:Label

label to branch to if both of the objects are null

process_arrayback to summary
public static void process_array(CodeEmitter e, Type type, ProcessArrayCallback callback)

Process an array on the stack. Assumes the top item on the stack is an array of the specified type. For each element in the array, puts the element on the stack and triggers the callback.

Parameters
type:Type

the type of the array (type.isArray() must be true)

callback:ProcessArrayCallback

the callback triggered for each element

process_arraysback to summary
public static void process_arrays(CodeEmitter e, Type type, ProcessArrayCallback callback)

Process two arrays on the stack in parallel. Assumes the top two items on the stack are arrays of the specified class. The arrays must be the same length. For each pair of elements in the arrays, puts the pair on the stack and triggers the callback.

Parameters
type:Type

the type of the arrays (type.isArray() must be true)

callback:ProcessArrayCallback

the callback triggered for each pair of elements

push_arrayback to summary
public static void push_array(CodeEmitter e, Object[] array)
push_objectback to summary
public static void push_object(CodeEmitter e, Object obj)
remapComponentTypeback to summary
private static Class<T> remapComponentType(Class<T> componentType)
shrinkStringBufferback to summary
private static void shrinkStringBuffer(CodeEmitter e, int amt)
string_switchback to summary
public static void string_switch(CodeEmitter e, String[] strings, int switchStyle, ObjectSwitchCallback callback)
string_switch_hashback to summary
private static void string_switch_hash(final CodeEmitter e, final String[] strings, final ObjectSwitchCallback callback, final boolean skipEquals) throws Exception
string_switch_trieback to summary
private static void string_switch_trie(final CodeEmitter e, String[] strings, final ObjectSwitchCallback callback) throws Exception
stringSwitchHelperback to summary
private static void stringSwitchHelper(final CodeEmitter e, List<E> strings, final ObjectSwitchCallback callback, final Label def, final Label end, final int index) throws Exception
wrap_throwableback to summary
public static void wrap_throwable(Block block, Type wrapper)
wrap_undeclared_throwableback to summary
public static void wrap_undeclared_throwable(CodeEmitter e, Block handler, Type[] exceptions, Type wrapper)
org.springframework.cglib.core back to summary

public Class EmitUtils.ArrayDelimiters

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private String
private String
private String

Constructor Summary

AccessConstructor and Description
public
ArrayDelimiters(String before, String inside, String after)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

afterback to summary
private String after
beforeback to summary
private String before
insideback to summary
private String inside

Constructor Detail

ArrayDelimitersback to summary
public ArrayDelimiters(String before, String inside, String after)
org.springframework.cglib.core back to summary

private Interface EmitUtils.ParameterTyper


Method Summary

Modifier and TypeMethod and Description
public Type[]

Method Detail

getParameterTypesback to summary
public Type[] getParameterTypes(MethodInfo member)