Top Description Inners Fields Constructors Methods
javassist.expr

public Class FieldAccess

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

Expression for accessing a field.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Field Summary

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

Constructor Summary

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

Method Summary

Modifier and TypeMethod and Description
public String
getClassName()

Returns the name of the class in which the field is declared.

private CtClass
getCtClass()

Returns the class in which the field is declared.

public CtField
getField()

Returns the field accessed by this expression.

public String
getFieldName()

Returns the name of the field.

public String

Returns:

null if this information is not available.
getFileName
()

Overrides javassist.expr.Expr.getFileName.

Returns the source file containing the field access.

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 field access.

public String
getSignature()

Returns the signature of the field type.

public boolean
isReader()

Returns true if the field is read.

public boolean
isStatic()

Returns true if the field is static.

pack-priv static boolean
isStatic(int c)

public boolean
isWriter()

Returns true if the field is written in.

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 method call with the bytecode derived from the given source text.

public CtBehavior
where()

Overrides javassist.expr.Expr.where.

Returns the method or constructor containing the field-access expression represented by this object.

Inherited from javassist.expr.Expr:
checkResultValueeditedgetConstPoolgetEnclosingClassindexOfBytecodelocalsreplacereplace0runEditorstackstoreStackwithinStatic

Field Detail

opcodeback to summary
pack-priv int opcode

Constructor Detail

FieldAccessback to summary
protected FieldAccess(int pos, CodeIterator i, CtClass declaring, MethodInfo m, int op)

Method Detail

getClassNameback to summary
public String getClassName()

Returns the name of the class in which the field is declared.

getCtClassback to summary
private CtClass getCtClass() throws NotFoundException

Returns the class in which the field is declared.

getFieldback to summary
public CtField getField() throws NotFoundException

Returns the field accessed by this expression.

getFieldNameback to summary
public String getFieldName()

Returns the name of the field.

getFileNameback to summary
public String getFileName()

Overrides javassist.expr.Expr.getFileName.

Returns the source file containing the field access.

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 field access.

Returns:int

-1 if this information is not available.

Annotations
@Override
getSignatureback to summary
public String getSignature()

Returns the signature of the field type. The signature is represented by a character string called field descriptor, which is defined in the JVM specification.

Since
3.1
See Also
javassist.bytecode.Descriptor#toCtClass(String, ClassPool)
isReaderback to summary
public boolean isReader()

Returns true if the field is read.

isStaticback to summary
public boolean isStatic()

Returns true if the field is static.

isStaticback to summary
pack-priv static boolean isStatic(int c)
isWriterback to summary
public boolean isWriter()

Returns true if the field is written in.

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 method call 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: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 field-access expression represented by this object.

Annotations
@Override
javassist.expr back to summary

pack-priv Class FieldAccess.ProceedForRead

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

Field Summary

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

Constructor Summary

AccessConstructor and Description
pack-priv
ProceedForRead(CtClass type, int op, int i, int var)

Method Summary

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

Field Detail

fieldTypeback to summary
pack-priv CtClass fieldType
indexback to summary
pack-priv int index
opcodeback to summary
pack-priv int opcode
targetVarback to summary
pack-priv int targetVar

Constructor Detail

ProceedForReadback to summary
pack-priv ProceedForRead(CtClass type, int op, int i, int var)

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
javassist.expr back to summary

pack-priv Class FieldAccess.ProceedForWrite

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

Field Summary

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

Constructor Summary

AccessConstructor and Description
pack-priv
ProceedForWrite(CtClass type, int op, int i, int var)

Method Summary

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

Field Detail

fieldTypeback to summary
pack-priv CtClass fieldType
indexback to summary
pack-priv int index
opcodeback to summary
pack-priv int opcode
targetVarback to summary
pack-priv int targetVar

Constructor Detail

ProceedForWriteback to summary
pack-priv ProceedForWrite(CtClass type, int op, int i, int var)

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