|
||||||||||
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.ConstructorDeclaration
The ConstructorDeclaration
class represents
constructor declaration node of the parse tree.
NonLeaf
,
MemberDeclaration
,
ModifierList
,
ParameterList
,
TypeName
,
ConstructorInvocation
,
StatementList
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) |
ConstructorDeclaration()
for recursive copy |
|
ConstructorDeclaration(ModifierList modiflist,
String name,
ParameterList params,
TypeName[] throwlist,
ConstructorInvocation scstmt,
StatementList stmtlist)
Constructs new ConstructorDeclaration from its elements. |
|
ConstructorDeclaration(ModifierList modiflist,
String name,
ParameterList params,
TypeName[] throwlist,
StatementList stmtlist)
Constructs new ConstructorDeclaration 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 the statement list of this constructor body. |
ConstructorInvocation |
getConstructorInvocation()
Gets the special call statement. |
ModifierList |
getModifiers()
Gets modifier list. |
String |
getName()
Gets the name of this constructor node. |
ParameterList |
getParameters()
Gets the parameter list. |
Hashtable |
getSuffixes()
|
TypeName[] |
getThrows()
Gets the class type list thrown by this constructor. |
void |
setBody(StatementList stmts)
Sets the statement list of this constructor body. |
void |
setConstructorInvocation(ConstructorInvocation scstmt)
Sets the special call statement. |
void |
setModifiers(ModifierList modifs)
Sets modifier list. |
void |
setName(String name)
Sets the name of this constructor node. |
void |
setParameters(ParameterList params)
Sets the parameter list. |
void |
setSuffixes(Hashtable suffixes)
|
void |
setThrows(TypeName[] ctlist)
Sets the class type list thrown by this constructor. |
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 ConstructorDeclaration(ModifierList modiflist, String name, ParameterList params, TypeName[] throwlist, ConstructorInvocation scstmt, StatementList stmtlist)
modiflist
- modifier list, if it has no modifier list
then thes arg is set empty list.name
- name of this constructor.params
- parameter listthrowlist
- throw type list, if there is no throws
then this arg is set empty listscstmt
- statement which calls another constructor
if this is null, it means no another constructor
call exists.stmtlist
- statement list of this constructor body.
if this is null, it means method body is with
only semi colon.public ConstructorDeclaration(ModifierList modiflist, String name, ParameterList params, TypeName[] throwlist, StatementList stmtlist)
modiflist
- modifier list, if it has no modifier list
then thes arg is set empty list.name
- name of this constructor.params
- parameter listthrowlist
- throw type list, if there is no throws
then this arg is set empty liststmtlist
- statement list of this constructor body.
if this is null, it means method body is with
only semi colon.ConstructorDeclaration()
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.public String getName()
public void setName(String name)
name
- the name to be set.public ParameterList getParameters()
public void setParameters(ParameterList params)
params
- parameterlist for constructor declarator node.public TypeName[] getThrows()
public void setThrows(TypeName[] ctlist)
ctlist
- class type list thrown by this constructor.public ConstructorInvocation getConstructorInvocation()
super();
public void setConstructorInvocation(ConstructorInvocation scstmt)
scstmt
- the special call statement to setgetConstructorInvocation()
public StatementList getBody()
public void setBody(StatementList stmts)
public 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 |