|
|||||||||
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.MethodDeclaration
The MethodDeclaration class presents method declaration node of parse tree.
ParseTree
,
NonLeaf
,
FieldDeclaration
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 | |
MethodDeclaration(ModifierList modiflist,
TypeName typespec,
java.lang.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. |
java.lang.String |
getName()
Gets name of this method. |
ParameterList |
getParameters()
Gets parameter list of this method. |
TypeName |
getReturnType()
Gets type specifier of this method. |
java.util.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(java.lang.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(java.util.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,
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 |
Constructor Detail |
public MethodDeclaration(ModifierList modiflist, TypeName typespec, java.lang.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 specifiermethoddecl
- method declaratorthrowlist
- 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 interfaceMethod Detail |
public void writeCode()
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 java.lang.String getName()
public void setName(java.lang.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)
class
- type list to setpublic StatementList getBody()
public void setBody(StatementList stmts)
stmts
- statement list to setpublic void setSuffixes(java.util.Hashtable suffixes)
public java.util.Hashtable getSuffixes()
public void accept(ParseTreeVisitor v) throws ParseTreeException
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.
visitor
- a visitor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |