When a class is first created, it has:
MethodBuilder implementations are required to supply a way for Generators to give them code. Most typically, they may have a stream to which the Generator writes the code that is of the type to satisfy what the Generator is writing.
BCClass is a ClassBuilder implementation for generating java bytecode directly.
| Modifier and Type | Field and Description |
|---|---|
| protected ClassHolder | |
| pack-priv final Type | |
| pack-priv BCJava | |
| pack-priv String | limitMsg
Simple text indicating any limits execeeded while generating the class file. |
| protected String | |
| protected String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public LocalField | addField(String
The type of the field in java language. javaType, String The name of the field. name, int The | of the modifier values such as
public, static, etc. modifiers)Implements org. add a field to this class. |
| pack-priv void | addLimitExceeded(BCMethod mb, String limitName, int limit, int value)
Add the fact that some class limit was exceeded while generating the class. |
| pack-priv void | addLimitExceeded(String
Text to be reported. rawText)Add the fact that some class limit was exceeded while generating the class. |
| public ByteArray | getClassBytecode()
Implements org. At the time the class is completed and bytecode generated, if there are no constructors then the default no-arg constructor will be defined. |
| pack-priv ClassFactory | |
| public String | getName()
Implements org. the class's unqualified name |
| pack-priv String | |
| pack-priv ClassHolder | |
| public MethodBuilder | Returns: the method builder for the constructor.the | of the Modifiers
constants representing the visibility and control of this
method. modifiers)Implements org. a constructor.</verbatim> |
| public MethodBuilder | Returns: the method builder.the | of the Modifiers
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)Implements org. a method.</verbatim> |
| public MethodBuilder | Returns: the method builder.the | of the Modifiers
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 ParameterDeclarations representing the
method's parameters parms)Implements org. a method with parameters.</verbatim> |
| classHold | back to summary |
|---|---|
| protected ClassHolder classHold | |
| classType | back to summary |
|---|---|
| pack-priv final Type classType | |
| factory | back to summary |
|---|---|
| pack-priv BCJava factory | |
| limitMsg | back to summary |
|---|---|
| pack-priv String limitMsg Simple text indicating any limits execeeded while generating the class file. | |
| name | back to summary |
|---|---|
| protected String name | |
| superClassName | back to summary |
|---|---|
| protected String superClassName | |
| BCClass | back to summary |
|---|---|
| pack-priv BCClass(ClassFactory cf, String packageName, int classModifiers, String className, String superClassName, BCJava factory) | |
| addField | back to summary |
|---|---|
| public LocalField addField(String javaType, String name, int modifiers) Implements org. 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. static fields also added to this list, with the modifier set appropriately.
| |
| addLimitExceeded | back to summary |
|---|---|
| pack-priv void addLimitExceeded(BCMethod mb, String limitName, int limit, int value) Add the fact that some class limit was exceeded while generating the class. We create a set of them and report at the end, this allows the generated class file to still be dumped. | |
| addLimitExceeded | back to summary |
|---|---|
| pack-priv void addLimitExceeded(String rawText) Add the fact that some class limit was exceeded while generating the class. Text is the simple string passed in.
| |
| getClassBytecode | back to summary |
|---|---|
| public ByteArray getClassBytecode() throws StandardException Implements org. At the time the class is completed and bytecode generated, if there are no constructors then the default no-arg constructor will be defined. | |
| getClassFactory | back to summary |
|---|---|
| pack-priv ClassFactory getClassFactory() | |
| getName | back to summary |
|---|---|
| public String getName() Implements org. the class's unqualified name | |
| getSuperClassName | back to summary |
|---|---|
| pack-priv String getSuperClassName() | |
| modify | back to summary |
|---|---|
| pack-priv ClassHolder modify() Let those that need to get to the classModify tool to alter the class definition. | |
| newConstructorBuilder | back to summary |
|---|---|
| public MethodBuilder newConstructorBuilder(int modifiers) Implements org. a constructor. 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. See Modifiers
| |
| newMethodBuilder | back to summary |
|---|---|
| public MethodBuilder newMethodBuilder(int modifiers, String returnType, String methodName) Implements org. a method. 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. See java.lang.reflect.Modifiers
| |
| newMethodBuilder | back to summary |
|---|---|
| public MethodBuilder newMethodBuilder(int modifiers, String returnType, String methodName, String[] parms) Implements org. 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. See java.lang.reflect.Modifiers
| |