| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private Bytecode | |
| pack-priv JvstCodeGen | |
| public static final String | |
| public static final String | |
| public static final String | |
| pack-priv SymbolTable |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public CtMember | |
| public Bytecode | compileBody(CtBehavior method, String
a single statement or a block.
If null, this method produces a body returning zero or null. src)Compiles a method (or constructor) body. |
| public void | |
| public void | |
| private CtField | |
| private CtBehavior | |
| public void | |
| public Bytecode | |
| private static void | |
| public static ASTree | |
| public boolean | Returns: false if the CodeAttribute does not include a LocalVariableAttribute.program counter (>= 0) pc)Records local variables available at the specified program counter. |
| public boolean | Returns: false if the CodeAttribute does not include a LocalVariableAttribute.the number of local variables used
for storing the parameters. numOfLocalVars)Records parameter names if the LocalVariableAttribute is available. |
| public int | recordParams(CtClass[] params, boolean isStatic)
Makes variables $0 (this), $1, $2, ..., and $args represent method parameters. |
| public int | recordParams(String
the type of $0 (it can be null if use0 is false).
It is used as the name of the type represented
by $class. target, CtClass[] params, boolean true if $0 is used. use0, int the register number of $0 (use0 is true)
or $1 (otherwise). varNo, boolean true if the method in which the compiled bytecode
is embedded is static. isStatic)Makes variables $0, $1, $2, ..., and $args represent method parameters. |
| public void | recordProceed(String
an expression specifying the target object.
if null, "this" is the target. target, String the method name. method)Prepares to use $proceed(). |
| public void | |
| public int | Returns: -1 or the variable index assigned to $_.the return type. type, boolean true if $_ is used. useResultVar)Prepares to use cast $r, $w, $_, and $type. |
| public void | recordSpecialProceed(String
an expression specifying the target object.
if null, "this" is the target. target, final String the class name declaring the method. classname, final String the method name. methodname, final String the method descriptor. descriptor, final int methodIndex)Prepares to use $proceed() representing a private/super's method. |
| public void | recordStaticProceed(String
the fully-qualified dot-separated name
of the class declaring the method. targetClass, String the method name. method)Prepares to use $proceed() representing a static method. |
| public void | |
| public int | recordVariable(CtClass
variable type type, String variable name name)Makes the given variable available. |
| public void |
| bytecode | back to summary |
|---|---|
| private Bytecode bytecode | |
| gen | back to summary |
|---|---|
| pack-priv JvstCodeGen gen | |
| param0Name | back to summary |
|---|---|
| public static final String param0Name | |
| proceedName | back to summary |
|---|---|
| public static final String proceedName | |
| resultVarName | back to summary |
|---|---|
| public static final String resultVarName | |
| stable | back to summary |
|---|---|
| pack-priv SymbolTable stable | |
| Javac | back to summary |
|---|---|
| public Javac(CtClass thisClass) Constructs a compiler.
| |
| Javac | back to summary |
|---|---|
| public Javac(Bytecode b, CtClass thisClass) Constructs a compiler.
The produced bytecode is stored in the
| |
| compile | back to summary |
|---|---|
| public CtMember compile(String src) throws CompileError Compiles a method, constructor, or field declaration to a class. A field declaration can declare only one field. In a method or constructor body, $0, $1, ... and $_ are not available.
| |
| compileBody | back to summary |
|---|---|
| public Bytecode compileBody(CtBehavior method, String src) throws CompileError Compiles a method (or constructor) body.
| |
| compileExpr | back to summary |
|---|---|
| public void compileExpr(String src) throws CompileError Compiles an exression. Local variables are not accessible
within the compiled source text. Fields and method parameters
($0, $1, ..) are available if | |
| compileExpr | back to summary |
|---|---|
| public void compileExpr(ASTree e) throws CompileError Compiles an exression. Local variables are not accessible
within the compiled source text. Fields and method parameters
($0, $1, ..) are available if | |
| compileField | back to summary |
|---|---|
| private CtField compileField(FieldDecl fd) throws CompileError, CannotCompileException | |
| compileMethod | back to summary |
|---|---|
| private CtBehavior compileMethod(Parser p, MethodDecl md) throws CompileError | |
| compileStmnt | back to summary |
|---|---|
| public void compileStmnt(String src) throws CompileError Compiles a statement (or a block).
Local variables that are not declared in the compiled source text might not be accessible within that source text. Fields and method parameters ($0, $1, ..) are available. | |
| getBytecode | back to summary |
|---|---|
| public Bytecode getBytecode() Returns the produced bytecode. | |
| makeDefaultBody | back to summary |
|---|---|
| private static void makeDefaultBody(Bytecode b, CtClass type) | |
| parseExpr | back to summary |
|---|---|
| public static ASTree parseExpr(String src, SymbolTable st) throws CompileError Parsers an expression. | |
| recordLocalVariables | back to summary |
|---|---|
| public boolean recordLocalVariables(CodeAttribute ca, int pc) throws CompileError Records local variables available at the specified program counter. If the LocalVariableAttribute is not available, this method does not record any local variable. It only returns false.
| |
| recordParamNames | back to summary |
|---|---|
| public boolean recordParamNames(CodeAttribute ca, int numOfLocalVars) throws CompileError Records parameter names if the LocalVariableAttribute is available. It returns false unless the LocalVariableAttribute is available.
| |
| recordParams | back to summary |
|---|---|
| public int recordParams(CtClass[] params, boolean isStatic) throws CompileError Makes variables $0 (this), $1, $2, ..., and $args represent method parameters. $args represents an array of all the parameters. It also makes $$ available as a parameter list of method call. This must be called before calling | |
| recordParams | back to summary |
|---|---|
| public int recordParams(String target, CtClass[] params, boolean use0, int varNo, boolean isStatic) throws CompileError Makes variables $0, $1, $2, ..., and $args represent method parameters. $args represents an array of all the parameters. It also makes $$ available as a parameter list of method call. $0 can represent a local variable other than THIS (variable 0). $class is also made available. This must be called before calling
| |
| recordProceed | back to summary |
|---|---|
| public void recordProceed(String target, String method) throws CompileError Prepares to use $proceed(). If the return type of $proceed() is void, null is pushed on the stack. | |
| recordProceed | back to summary |
|---|---|
| public void recordProceed(ProceedHandler h) Prepares to use $proceed(). | |
| recordReturnType | back to summary |
|---|---|
| public int recordReturnType(CtClass type, boolean useResultVar) throws CompileError Prepares to use cast $r, $w, $_, and $type. $type is made to represent the specified return type. It also enables to write a return statement with a return value for void method. If the return type is void, ($r) does nothing. The type of $_ is java.lang.Object.
| |
| recordSpecialProceed | back to summary |
|---|---|
| public void recordSpecialProceed(String target, final String classname, final String methodname, final String descriptor, final int methodIndex) throws CompileError Prepares to use $proceed() representing a private/super's method. If the return type of $proceed() is void, null is pushed on the stack. This method is for methods invoked by INVOKESPECIAL. | |
| recordStaticProceed | back to summary |
|---|---|
| public void recordStaticProceed(String targetClass, String method) throws CompileError Prepares to use $proceed() representing a static method. If the return type of $proceed() is void, null is pushed on the stack. | |
| recordType | back to summary |
|---|---|
| public void recordType(CtClass t) Prepares to use $type. Note that recordReturnType() overwrites the value of $type.
| |
| recordVariable | back to summary |
|---|---|
| public int recordVariable(CtClass type, String name) throws CompileError Makes the given variable available. | |
| setMaxLocals | back to summary |
|---|---|
| public void setMaxLocals(int max) Sets This method is indirectly called by | |
| Modifier and Type | Field and Description |
|---|---|
| private ASTree |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected ASTree | |
| protected void |
| init | back to summary |
|---|---|
| private ASTree init | |
| CtFieldWithInit | back to summary |
|---|---|
| pack-priv CtFieldWithInit(CtClass type, String name, CtClass declaring) throws CannotCompileException | |
| getInitAST | back to summary |
|---|---|
| protected ASTree getInitAST() Overrides javassist.
| |
| setInit | back to summary |
|---|---|
| protected void setInit(ASTree i) | |