Package de.ufinke.cubaja.cafebabe
Class GenClass
- java.lang.Object
-
- de.ufinke.cubaja.cafebabe.GenClass
-
- All Implemented Interfaces:
AccessFlags
public class GenClass extends Object implements AccessFlags
Wrapper for a generated class. An instance is built by aGenerator.- 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 Concrete Methods Modifier and Type Method Description GenMethodcreateConstructor(int methodAccessFlags, Type... args)Creates a constructor.voidcreateDefaultConstructor()Creates an empty default constructor.GenFieldcreateField(int fieldAccessFlags, Type type, String fieldName)Creates a field.GenMethodcreateMethod(int methodAccessFlags, Type returnType, String methodName, Type... args)Creates a method.voidgenerate(DataOutputStream out)StringgetName()Returns the class name.
-
-
-
Method Detail
-
createField
public GenField createField(int fieldAccessFlags, Type type, String fieldName)
Creates a field.- Parameters:
fieldAccessFlags- access bits of the fieldtype- type of the fieldfieldName- name of the field- Returns:
- field
-
createMethod
public GenMethod createMethod(int methodAccessFlags, Type returnType, String methodName, Type... args)
Creates a method.- Parameters:
methodAccessFlags- access bits of the methodreturnType- return type of the methodmethodName- name of the methodargs- argument types of the method- Returns:
- method
-
createConstructor
public GenMethod createConstructor(int methodAccessFlags, Type... args)
Creates a constructor.- Parameters:
methodAccessFlags- access bitsargs- argument types of the constructor- Returns:
- constructor (method with name '<init>')
-
createDefaultConstructor
public void createDefaultConstructor()
Creates an empty default constructor.
-
getName
public String getName()
Returns the class name.- Returns:
- class name
-
generate
public void generate(DataOutputStream out) throws Exception
- Throws:
Exception
-
-