public class EnumCreator extends AbstractClassCreatorContext
haveInitMethod, scclassOutPutPath, cw, existedStaticBlock, fieldCreators, methodCreaters| 构造器和说明 |
|---|
EnumCreator(int version,
String name,
Class<?>[] interfaces) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
beforeCreate() |
void |
createConstructor(AClass[] argClasses,
String[] argNames,
KernelEnumConstructorBody mb)
create constructor;
|
protected void |
createDefaultConstructor() |
void |
createEnumConstant(String name) |
IFieldCreator |
createField(String name,
int modifiers,
AClass type)
Create a field with null value.
|
IFieldCreator |
createField(String name,
int modifiers,
AClass type,
Object value)
Create a field with special value.
|
void |
createMethod(String name,
AClass[] argClasses,
String[] argNames,
AClass returnClass,
AClass[] exceptions,
int access,
KernelMethodBody mb) |
void |
createMethodForDummy(String name,
AClass[] argClasses,
String[] argNames,
AClass returnClass,
AClass[] exceptions,
int access,
KernelMethodBody mb) |
void |
createStaticBlock(KernelEnumStaticBlockBody body) |
void |
createStaticMethod(String name,
AClass[] argClasses,
String[] argNames,
AClass returnClass,
AClass[] exceptions,
int access,
KernelStaticMethodBody mb) |
getCurrentClass, startupcheckStaticBlock, getClassOutPutPath, getClassVisitor, getParentClassLoader, loadClass, setClassOutPutPath, setParentClassLoadergetArrayType, getArrayType, getType, newSemiClasspublic IFieldCreator createField(String name, int modifiers, AClass type)
name - the field namemodifiers - the field modifierstype - the field typepublic IFieldCreator createField(String name, int modifiers, AClass type, Object value)
name - modifiers - type - value - The initial value, this value is only support static field,
otherwise will ignored.This parameter, which may be null if
the field does not have an initial value, must be an Integer,
a Float, a Long, a Double or a String (for int, float, long or
String fields respectively). This parameter is only used for
static fields. Its value is ignored for non static fields,
which must be initialized through bytecode instructions in
constructors or methods.public void createEnumConstant(String name)
name - public final void createMethodForDummy(String name, AClass[] argClasses, String[] argNames, AClass returnClass, AClass[] exceptions, int access, KernelMethodBody mb)
name - argClasses - argNames - returnClass - exceptions - access - mb - public final void createMethod(String name, AClass[] argClasses, String[] argNames, AClass returnClass, AClass[] exceptions, int access, KernelMethodBody mb)
name - arguments - argNames - returnClass - exceptions - access - mb - public void createStaticMethod(String name, AClass[] argClasses, String[] argNames, AClass returnClass, AClass[] exceptions, int access, KernelStaticMethodBody mb)
name - argClasses - argNames - returnClass - exceptions - access - mb - public void createConstructor(AClass[] argClasses, String[] argNames, KernelEnumConstructorBody mb)
arguments - argNames - mb - access - public void createStaticBlock(KernelEnumStaticBlockBody body)
mb - protected void createDefaultConstructor()
protected void beforeCreate()
Copyright © 2015. All rights reserved.