public abstract class ConstructorAccess<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
isNonStaticMemberClass |
Constructor and Description |
---|
ConstructorAccess() |
Modifier and Type | Method and Description |
---|---|
static <T> ConstructorAccess<T> |
get(java.lang.Class<T> type) |
private static void |
insertConstructor(org.objectweb.asm.ClassWriter cw,
java.lang.String superclassNameInternal) |
(package private) static void |
insertNewInstance(org.objectweb.asm.ClassWriter cw,
java.lang.String classNameInternal) |
(package private) static void |
insertNewInstanceInner(org.objectweb.asm.ClassWriter cw,
java.lang.String classNameInternal,
java.lang.String enclosingClassNameInternal) |
boolean |
isNonStaticMemberClass() |
abstract T |
newInstance()
Constructor for top-level classes and static nested classes.
|
abstract T |
newInstance(java.lang.Object enclosingInstance)
Constructor for inner classes (non-static nested classes).
|
public boolean isNonStaticMemberClass()
public abstract T newInstance()
If the underlying class is a inner (non-static nested) class, a new instance will be created using null
as the
this$0 synthetic reference. The instantiated object will work as long as it actually don't use any member variable or method
fron the enclosing instance.
public abstract T newInstance(java.lang.Object enclosingInstance)
enclosingInstance
- The instance of the enclosing type to which this inner instance is related to (assigned to its
synthetic this$0 field).public static <T> ConstructorAccess<T> get(java.lang.Class<T> type)
private static void insertConstructor(org.objectweb.asm.ClassWriter cw, java.lang.String superclassNameInternal)
static void insertNewInstance(org.objectweb.asm.ClassWriter cw, java.lang.String classNameInternal)
static void insertNewInstanceInner(org.objectweb.asm.ClassWriter cw, java.lang.String classNameInternal, java.lang.String enclosingClassNameInternal)