|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.ptree.ParseTreeObject | +--openjava.ptree.NonLeaf | +--openjava.ptree.FieldAccess
The FieldAccess
class represents
a field access like :
f().str
f()
by getReferenceExpr()
and can get str
by getName()
.
NonLeaf
,
Expression
Fields inherited from class openjava.ptree.ParseTreeObject |
debugFlag, debugLevel, LN, out, writerStack |
Constructor Summary | |
FieldAccess(Expression expr,
java.lang.String name)
An access to the specified field of the given expression. |
|
FieldAccess(OJClass clazz,
java.lang.String name)
An access to the specified static field of the type. |
|
FieldAccess(java.lang.String name)
An access to the specified field of self. |
|
FieldAccess(TypeName typename,
java.lang.String name)
An access to the specified static field of the type. |
Method Summary | |
void |
accept(ParseTreeVisitor v)
Accepts a ParseTreeVisitor object as the role of a
Visitor in the Visitor pattern, as the role of an Element in the
Visitor pattern. |
java.lang.String |
getName()
Gets the field name. |
ParseTree |
getReference()
|
Expression |
getReferenceExpr()
Gets the expression accessed. |
TypeName |
getReferenceType()
|
OJClass |
getType(Environment env)
|
boolean |
isTypeReference()
|
void |
setName(java.lang.String name)
Sets the field name. |
void |
setReferenceExpr(Expression expr)
Sets the expression accessed. |
void |
setReferenceType(TypeName typename)
|
void |
writeCode()
Writes the code this parse-tree presents for. |
Methods inherited from class openjava.ptree.NonLeaf |
childrenAccept, elementAt, equals, getComment, getContents, getLength, makeRecursiveCopy, replaceChildWith, set, set, set, set, set, set, set, set, set, setComment, setElementAt |
Methods inherited from class openjava.ptree.ParseTreeObject |
clone, eq, eq, equal, flushPrintWriter, getDebugFlag, getNest, getObjectID, getParent, getPrintWriter, getTab, hashCode, lastObjectID, makeCopy, popNest, popPrintWriter, pushNest, pushPrintWriter, replace, setDebugFlag, setDebugLevel, setNest, setParent, setPrintStream, setTab, toFlattenString, toString, writeDebug, writeDebugL, writeDebugLln, writeDebugln, writeDebugLR, writeDebugR, writeDebugRln, writeTab |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface openjava.ptree.ParseTree |
childrenAccept, eq, equals, getObjectID, makeCopy, makeRecursiveCopy, replace, toFlattenString, toString |
Constructor Detail |
public FieldAccess(Expression expr, java.lang.String name)
public FieldAccess(TypeName typename, java.lang.String name)
public FieldAccess(OJClass clazz, java.lang.String name)
public FieldAccess(java.lang.String name)
Method Detail |
public void writeCode()
NonLeaf
writeCode
in interface ParseTree
writeCode
in class NonLeaf
public ParseTree getReference()
public boolean isTypeReference()
public Expression getReferenceExpr()
public void setReferenceExpr(Expression expr)
expr
- the expression accessed.public TypeName getReferenceType()
public void setReferenceType(TypeName typename)
public java.lang.String getName()
public void setName(java.lang.String name)
name
- the field name.public void accept(ParseTreeVisitor v) throws ParseTreeException
ParseTree
ParseTreeVisitor
object as the role of a
Visitor in the Visitor pattern, as the role of an Element in the
Visitor pattern.
This invoke an appropriate visit()
method on the
accepted visitor.
accept
in interface ParseTree
accept
in class ParseTreeObject
openjava.ptree.ParseTree
visitor
- a visitorpublic OJClass getType(Environment env) throws java.lang.Exception
getType
in interface Expression
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |