Package de.ufinke.cubaja.cafebabe
Interface Generator
-
- All Superinterfaces:
AccessFlags
public interface Generator extends AccessFlags
Bytecode generator.Example (the sample method in the generated class does nothing):
public GenClass generate(String className) throws Exception { Type objectType = new Type(Object.class); GenClass genClass = new GenClass(ACC_PUBLIC | ACC_FINAL, className, objectType); genClass.createDefaultConstructor(); Type voidType = new Type(Void.TYPE); GenMethod method = genClass.createMethod(ACC_PUBLIC, voidType, "doNothing"); CodeAttribute code = method.getCode(); code.returnVoid(); return genClass; }- Author:
- Uwe Finke
-
-
Field Summary
-
Fields inherited from interface de.ufinke.cubaja.cafebabe.AccessFlags
ACC_ABSTRACT, ACC_ANNOTATION, ACC_BRIDGE, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VARARGS, ACC_VOLATILE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GenClassgenerate(String className)Generates bytecode.
-