public class ClassCreator extends AbstractClassCreatorContext
haveInitMethod, scclassOutPutPath, cw, existedStaticBlock, fieldCreators, methodCreaters| 构造器和说明 |
|---|
ClassCreator(int version,
int access,
String name,
Class<?> superCls,
Class<?>[] interfaces) |
beforeCreate, 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 val)
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 IMethodCreator createConstructor(int access, AClass[] argTypes, String[] argNames, AClass[] exceptions, KernelConstructorBody body)
access - argTypes - argNames - body - public IMethodCreator createMethodForDummy(int access, String name, AClass[] argTypes, String[] argNames, AClass returnClass, AClass[] exceptions, KernelMethodBody body)
createMethod(int, java.lang.String, cn.wensiqun.asmsupport.standard.def.clazz.AClass[], java.lang.String[], cn.wensiqun.asmsupport.standard.def.clazz.AClass, cn.wensiqun.asmsupport.standard.def.clazz.AClass[], cn.wensiqun.asmsupport.core.block.method.common.KernelMethodBody) methodaccess - name - argTypes - argNames - returnClass - exceptions - body - public IMethodCreator createMethod(int access, String name, AClass[] argTypes, String[] argNames, AClass returnClass, AClass[] exceptions, KernelMethodBody body)
access - the method modifiersname - the method nameargClasses - the method argument type listargNames - the method arguments name listreturnClass - the method return classexceptions - throw exceptions for this methodbody - method body that is method logic implementationpublic IMethodCreator createStaticMethod(int access, String name, AClass[] argTypes, String[] argNames, AClass returnClass, AClass[] exceptions, KernelStaticMethodBody body)
access - the method modifiersname - the method nameargTypes - the method argument type listargNames - the method arguments name listreturnClass - the method return classexceptions - throw exceptions for this methodbody - method body that is method logic implementationpublic IMethodCreator createStaticBlock(KernelStaticBlockBody block)
block - protected void createDefaultConstructor()
Copyright © 2015. All rights reserved.