Top Description Inners Fields Constructors Methods
javassist.expr

public Class NewExpr

extends Expr
Class Inheritance
Imports
javassist.CannotCompileException, .ClassPool, .CtBehavior, .CtClass, .CtConstructor, .NotFoundException, javassist.bytecode.BadBytecode, .Bytecode, .CodeAttribute, .CodeIterator, .ConstPool, .Descriptor, .MethodInfo, .Opcode, javassist.compiler.CompileError, .Javac, .JvstCodeGen, .JvstTypeChecker, .ProceedHandler, javassist.compiler.ast.ASTList

Object creation (new expression).

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv String
Inherited from javassist.expr.Expr:
currentPoseditediteratorjavaLangObjectmaxLocalsmaxStackthisClassthisMethod

Constructor Summary

AccessConstructor and Description
protected
NewExpr(int pos, CodeIterator i, CtClass declaring, MethodInfo m, String type, int np)

Undocumented constructor.

Method Summary

Modifier and TypeMethod and Description
private int
public String
getClassName()

Returns the class name of the created object.

public CtConstructor
getConstructor()

Returns the constructor called for creating the object.

private CtClass
getCtClass()

Returns the class of the created object.

public String

Returns:

null if this information is not available.
getFileName
()

Overrides javassist.expr.Expr.getFileName.

Returns the source file containing the new expression.

public int

Returns:

-1 if this information is not available.
getLineNumber
()

Overrides javassist.expr.Expr.getLineNumber.

Returns the line number of the source line containing the new expression.

public String

Returns:

the signature
getSignature
()

Get the signature of the constructor The signature is represented by a character string called method descriptor, which is defined in the JVM specification.

public CtClass[]
mayThrow()

Overrides javassist.expr.Expr.mayThrow.

Returns the list of exceptions that the expression may throw.

public void
replace(String
a Java statement except try-catch.
statement
)

Implements abstract javassist.expr.Expr.replace.

Replaces the new expression with the bytecode derived from the given source text.

public CtBehavior
where()

Overrides javassist.expr.Expr.where.

Returns the method or constructor containing the new expression represented by this object.

Inherited from javassist.expr.Expr:
checkResultValueeditedgetConstPoolgetEnclosingClassindexOfBytecodelocalsreplacereplace0runEditorstackstoreStackwithinStatic

Field Detail

newPosback to summary
pack-priv int newPos
newTypeNameback to summary
pack-priv String newTypeName

Constructor Detail

NewExprback to summary
protected NewExpr(int pos, CodeIterator i, CtClass declaring, MethodInfo m, String type, int np)

Undocumented constructor. Do not use; internal-use only.

Method Detail

canReplaceback to summary
private int canReplace() throws CannotCompileException
getClassNameback to summary
public String getClassName()

Returns the class name of the created object.

getConstructorback to summary
public CtConstructor getConstructor() throws NotFoundException

Returns the constructor called for creating the object.

getCtClassback to summary
private CtClass getCtClass() throws NotFoundException

Returns the class of the created object.

getFileNameback to summary
public String getFileName()

Overrides javassist.expr.Expr.getFileName.

Returns the source file containing the new expression.

Returns:String

null if this information is not available.

Annotations
@Override
getLineNumberback to summary
public int getLineNumber()

Overrides javassist.expr.Expr.getLineNumber.

Returns the line number of the source line containing the new expression.

Returns:int

-1 if this information is not available.

Annotations
@Override
getSignatureback to summary
public String getSignature()

Get the signature of the constructor The signature is represented by a character string called method descriptor, which is defined in the JVM specification.

Returns:String

the signature

See Also
javassist.CtBehavior#getSignature(), javassist.bytecode.Descriptor
mayThrowback to summary
public CtClass[] mayThrow()

Overrides javassist.expr.Expr.mayThrow.

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.

Annotations
@Override
replaceback to summary
public void replace(String statement) throws CannotCompileException

Implements abstract javassist.expr.Expr.replace.

Replaces the new expression with the bytecode derived from the given source text.

$0 is available but the value is null.

Parameters
statement:String

a Java statement except try-catch.

Annotations
@Override
whereback to summary
public CtBehavior where()

Overrides javassist.expr.Expr.where.

Returns the method or constructor containing the new expression represented by this object.

Annotations
@Override
javassist.expr back to summary

pack-priv Class NewExpr.ProceedForNew

extends Object
implements ProceedHandler
Class Inheritance
All Implemented Interfaces
javassist.compiler.ProceedHandler

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv int
pack-priv CtClass

Constructor Summary

AccessConstructor and Description
pack-priv
ProceedForNew(CtClass nt, int ni, int mi)

Method Summary

Modifier and TypeMethod and Description
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

methodIndexback to summary
pack-priv int methodIndex
newIndexback to summary
pack-priv int newIndex
newTypeback to summary
pack-priv CtClass newType

Constructor Detail

ProceedForNewback to summary
pack-priv ProceedForNew(CtClass nt, int ni, int mi)

Method Detail

doitback to summary
public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args) throws CompileError

Implements javassist.compiler.ProceedHandler.doit.

Annotations
@Override
setReturnTypeback to summary
public void setReturnType(JvstTypeChecker c, ASTList args) throws CompileError

Implements javassist.compiler.ProceedHandler.setReturnType.

Annotations
@Override