| java.lang.Object javassist.expr.Expr javassist.expr.NewArray
NewArray | public class NewArray extends Expr (Code) | | Array creation.
This class does not provide methods for obtaining the initial
values of array elements.
|
Method Summary | |
public CtClass | getComponentType() Returns the type of array components. | public int | getCreatedDimensions() Returns the number of dimensions of arrays to be created.
If the opcode is multianewarray, this method returns the second
operand. | public int | getDimension() Returns the dimension of the created array. | public String | getFileName() Returns the source file containing the array creation. | public int | getLineNumber() Returns the line number of the source line containing the
array creation. | CtClass | getPrimitiveType(int atype) | public CtClass[] | mayThrow() Returns the list of exceptions that the expression may throw. | public void | replace(String statement) Replaces the array creation with the bytecode derived from
the given source text. | public CtBehavior | where() Returns the method or constructor containing the array creation
represented by this object. |
getComponentType | public CtClass getComponentType() throws NotFoundException(Code) | | Returns the type of array components. If the created array is
a two-dimensional array of int,
the type returned by this method is
not int[] but int.
|
getCreatedDimensions | public int getCreatedDimensions()(Code) | | Returns the number of dimensions of arrays to be created.
If the opcode is multianewarray, this method returns the second
operand. Otherwise, it returns 1.
|
getDimension | public int getDimension()(Code) | | Returns the dimension of the created array.
|
getFileName | public String getFileName()(Code) | | Returns the source file containing the array creation.
null if this information is not available. |
getLineNumber | public int getLineNumber()(Code) | | Returns the line number of the source line containing the
array creation.
-1 if this information is not available. |
mayThrow | public CtClass[] mayThrow()(Code) | | Returns the list of exceptions that the expression may throw.
This list includes both the exceptions that the try-catch statements
including the expression can catch and the exceptions that
the throws declaration allows the method to throw.
|
replace | public void replace(String statement) throws CannotCompileException(Code) | | Replaces the array creation with the bytecode derived from
the given source text.
$0 is available even if the called method is static.
If the field access is writing, $_ is available but the value
of $_ is ignored.
Parameters: statement - a Java statement. |
where | public CtBehavior where()(Code) | | Returns the method or constructor containing the array creation
represented by this object.
|
|
|