When a class is first created, it has:
MethodBuilder implementations are required to get code out of the constructs within their bodies in some manner. Most typically, they may have a stream to which the statement and expression constructs write the code that they represent, and they walk over the statements and expressions in the appropriate order.
| Modifier and Type | Method and Description |
|---|---|
| public LocalField | |
| public ByteArray | getClassBytecode()
At the time the class is completed and bytecode generated, if there are no constructors then the default no-arg constructor will be defined. |
| public String | |
| public GeneratedClass | getGeneratedClass()
Fully create the bytecode and load the class using the ClassBuilder's ClassFactory. |
| public String | |
| public MethodBuilder | Returns: the method builder for the constructor.the | of the Modifier
constants representing the visibility and control of this
method. modifiers)a constructor.</verbatim> |
| public MethodBuilder | Returns: the method builder.the | of the Modifier
constants representing the visibility and control of this
method. modifiers, String the return type of the method as its
Java language type name. returnType, String the name of the method. methodName)a method.</verbatim> |
| public MethodBuilder | Returns: the method builder.the | of the Modifier
constants representing the visibility and control of this
method. modifiers, String the return type of the method as its
Java language type name. returnType, String the name of the method. methodName, String[] an array of String representing the
method's parameter types parms)a method with parameters.</verbatim> |
| addField | back to summary |
|---|---|
| public LocalField addField(String type, String name, int modifiers) add a field to this class. Fields cannot be initialized here, they must be initialized in the static initializer code (static fields) or in the constructors. Methods are added when they are created with the JavaFactory.
| |
| getClassBytecode | back to summary |
|---|---|
| public ByteArray getClassBytecode() throws StandardException At the time the class is completed and bytecode generated, if there are no constructors then the default no-arg constructor will be defined. | |
| getFullName | back to summary |
|---|---|
| public String getFullName() the class's qualified name | |
| getGeneratedClass | back to summary |
|---|---|
| public GeneratedClass getGeneratedClass() throws StandardException Fully create the bytecode and load the class using the ClassBuilder's ClassFactory.
| |
| getName | back to summary |
|---|---|
| public String getName() the class's unqualified name | |
| newConstructorBuilder | back to summary |
|---|---|
| public MethodBuilder newConstructorBuilder(int modifiers) a constructor. Once it is created, parameters, thrown
exceptions, statements, and local variable declarations
must be added to it. It is put into its defining class
when it is created.
This is used to start a constructor as well; pass in null for the returnType when used in that manner.
| |
| newMethodBuilder | back to summary |
|---|---|
| public MethodBuilder newMethodBuilder(int modifiers, String returnType, String methodName) a method. Once it is created, parameters, thrown
exceptions, statements, and local variable declarations
must be added to it. It is put into its defining class
when it is created.
This is used to start a constructor as well; pass in null for the returnType when used in that manner.
| |
| newMethodBuilder | back to summary |
|---|---|
| public MethodBuilder newMethodBuilder(int modifiers, String returnType, String methodName, String[] parms) a method with parameters. Once it is created, thrown
exceptions, statements, and local variable declarations
must be added to it. It is put into its defining class
when it is created.
This is used to start a constructor as well; pass in null for the returnType when used in that manner.
| |