|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.ptree.ParseTreeObject | +--openjava.ptree.NonLeaf | +--openjava.ptree.MethodDeclaration
The MethodDeclaration class presents method declaration node of parse tree.
ParseTree
,
NonLeaf
,
FieldDeclaration
Field Summary | |
private Hashtable |
suffixes
|
Fields inherited from class openjava.ptree.NonLeaf |
|
Fields inherited from class openjava.ptree.ParseTreeObject |
debugFlag, debugLevel, LN, out, writerStack |
Fields inherited from interface openjava.ptree.MemberDeclaration |
CONSTRUCTOR, FIELD, METHOD, STATICINIT, STATICINITIALIZER, TYPE |
Constructor Summary | |
(package private) |
MethodDeclaration()
Is needed for recursive copy. |
|
MethodDeclaration(ModifierList modiflist,
TypeName typespec,
String name,
ParameterList params,
TypeName[] throwlist,
StatementList block)
Constructs new MethodDeclaration from its elements. |
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. |
StatementList |
getBody()
Gets body of this method. |
ModifierList |
getModifiers()
Gets modifierlist of this method. |
String |
getName()
Gets name of this method. |
ParameterList |
getParameters()
Gets parameter list of this method. |
TypeName |
getReturnType()
Gets type specifier of this method. |
Hashtable |
getSuffixes()
|
TypeName[] |
getThrows()
Gets throw type name list of this method. |
void |
setBody(StatementList stmts)
Sets body of this method. |
void |
setModifiers(ModifierList modifs)
Sets modifierlist of this method. |
void |
setName(String name)
Sets name of this method. |
void |
setParameters(ParameterList params)
Sets parameter list of this method. |
void |
setReturnType(TypeName tspec)
Sets type specifier of this method. |
void |
setSuffixes(Hashtable suffixes)
|
void |
setThrows(TypeName[] thrwlist)
Sets throw type name list of this method. |
void |
writeCode()
Writes the code this parse-tree presents for. |
Methods inherited from class openjava.ptree.NonLeaf |
childrenAccept, childrenAreEqual, elementAt, equals, getComment, getContents, getLength, getRowType, 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.MemberDeclaration |
eq, equals |
Methods inherited from interface openjava.ptree.ParseTree |
childrenAccept, getObjectID, makeCopy, makeRecursiveCopy, replace, toFlattenString, toString |
Field Detail |
private Hashtable suffixes
Constructor Detail |
public MethodDeclaration(ModifierList modiflist, TypeName typespec, String name, ParameterList params, TypeName[] throwlist, StatementList block)
modiflist
- modifier list. If it has no modifier list
then thes arg is set empty list.typespec
- returning type specifierthrowlist
- throw type list. If there is no throws
then this arg is set empty listblock
- method block. if arg block is null, it means method
body with only semi colon such as methods in interfaceMethodDeclaration()
Method Detail |
public void writeCode()
NonLeaf
writeCode
in interface MemberDeclaration
writeCode
in class NonLeaf
public ModifierList getModifiers()
public void setModifiers(ModifierList modifs)
modifs
- modifier list to setpublic TypeName getReturnType()
public void setReturnType(TypeName tspec)
tspec
- type specifier to setpublic String getName()
public void setName(String name)
name
- method's namepublic ParameterList getParameters()
public void setParameters(ParameterList params)
params
- parameter list to setpublic TypeName[] getThrows()
public void setThrows(TypeName[] thrwlist)
public StatementList getBody()
public void setBody(StatementList stmts)
stmts
- statement list to setpublic void setSuffixes(Hashtable suffixes)
public Hashtable getSuffixes()
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
v
- a visitor
ParseTreeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |