Top Description Inners Fields Constructors Methods
javassist.expr

public Class Cast

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

Explicit type cast.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Inherited from javassist.expr.Expr:
currentPoseditediteratorjavaLangObjectmaxLocalsmaxStackthisClassthisMethod

Constructor Summary

AccessConstructor and Description
protected
Cast(int pos, CodeIterator i, CtClass declaring, MethodInfo m)

Undocumented constructor.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

null if this information is not available.
getFileName
()

Overrides javassist.expr.Expr.getFileName.

Returns the source file containing the type-cast 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 type-cast expression.

public CtClass
getType()

Returns the CtClass object representing the type specified by the cast.

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 explicit cast operator with the bytecode derived from the given source text.

public CtBehavior
where()

Overrides javassist.expr.Expr.where.

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

Inherited from javassist.expr.Expr:
checkResultValueeditedgetConstPoolgetEnclosingClassindexOfBytecodelocalsreplacereplace0runEditorstackstoreStackwithinStatic

Constructor Detail

Castback to summary
protected Cast(int pos, CodeIterator i, CtClass declaring, MethodInfo m)

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

Method Detail

getFileNameback to summary
public String getFileName()

Overrides javassist.expr.Expr.getFileName.

Returns the source file containing the type-cast 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 type-cast expression.

Returns:int

-1 if this information is not available.

Annotations
@Override
getTypeback to summary
public CtClass getType() throws NotFoundException

Returns the CtClass object representing the type specified by the cast.

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 explicit cast operator 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 type cast expression represented by this object.

Annotations
@Override
javassist.expr back to summary

pack-priv Class Cast.ProceedForCast

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

Field Summary

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

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

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

Field Detail

indexback to summary
pack-priv int index
retTypeback to summary
pack-priv CtClass retType

Constructor Detail

ProceedForCastback to summary
pack-priv ProceedForCast(int i, CtClass t)

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