All Packages Class Hierarchy This Package Previous Next Index
Class openjava.ptree.ConstructorDeclaration
java.lang.Object
|
+----openjava.ptree.PtreeObject
|
+----openjava.ptree.NonLeaf
|
+----openjava.ptree.ConstructorDeclaration
- public class ConstructorDeclaration
- extends NonLeaf
- implements MemberDeclaration
The ConstructorDeclaration
class represents
constructor declaration node of the parse tree.
- See Also:
- NonLeaf, MemberDeclaration, ModifierList, Identifier, ParameterList, ClassTypeList, SpecialCallStatement, StatementList
-
ConstructorDeclaration(ModifierList, Identifier, ParameterList, ClassTypeList, SpecialCallStatement, StatementList)
- Constructs new ConstructorDeclaration from its elements.
-
ConstructorDeclaration(ModifierList, Identifier, ParameterList, ClassTypeList, StatementList)
- Constructs new ConstructorDeclaration from its elements.
-
getBody()
- Gets the statement list of this constructor body.
-
getModifiers()
- Gets modifier list.
-
getName()
- Gets the name of this constructor node.
-
getParameters()
- Gets the parameter list.
-
getSpecialCallStatement()
- Gets the special call statement.
-
getThrows()
- Gets the class type list thrown by this constructor.
-
make(String)
-
-
setBody(StatementList)
- Sets the statement list of this constructor body.
-
setModifiers(ModifierList)
- Sets modifier list.
-
setName(Identifier)
- Sets the name of this constructor node.
-
setParameters(ParameterList)
- Sets the parameter list.
-
setSpecialCallStatement(SpecialCallStatement)
- Sets the special call statement.
-
setThrows(ClassTypeList)
- Sets the class type list thrown by this constructor.
-
writeCode()
- Writes the code this parse-tree presents for.
ConstructorDeclaration
public ConstructorDeclaration(ModifierList modiflist,
Identifier name,
ParameterList params,
ClassTypeList throwlist,
SpecialCallStatement scstmt,
StatementList stmtlist)
- Constructs new ConstructorDeclaration from its elements.
- Parameters:
- modiflist - modifier list, if it has no modifier list
then thes arg is set empty list.
- name - name of this constructor.
- params - parameter list
- throwlist - throw type list, if there is no throws
then this arg is set empty list
- scstmt - 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.
ConstructorDeclaration
public ConstructorDeclaration(ModifierList modiflist,
Identifier name,
ParameterList params,
ClassTypeList throwlist,
StatementList stmtlist)
- Constructs new ConstructorDeclaration from its elements.
- Parameters:
- modiflist - modifier list, if it has no modifier list
then thes arg is set empty list.
- name - name of this constructor.
- params - parameter list
- throwlist - throw type list, if there is no throws
then this arg is set empty list
- stmtlist - statement list of this constructor body.
if this is null, it means method body is with
only semi colon.
writeCode
public void writeCode()
- Writes the code this parse-tree presents for.
- Overrides:
- writeCode in class NonLeaf
getModifiers
public ModifierList getModifiers()
- Gets modifier list.
- Returns:
- modifier list.
setModifiers
public void setModifiers(ModifierList modifs)
- Sets modifier list.
- Parameters:
- modifs - modifier list.
getName
public Identifier getName()
- Gets the name of this constructor node.
- Returns:
- constructor declarator node.
setName
public void setName(Identifier name)
- Sets the name of this constructor node.
- Parameters:
- name - the name to be set.
getParameters
public ParameterList getParameters()
- Gets the parameter list.
- Returns:
- parameter list for constructor.
setParameters
public void setParameters(ParameterList params)
- Sets the parameter list.
- Parameters:
- params - parameterlist for constructor declarator node.
getThrows
public ClassTypeList getThrows()
- Gets the class type list thrown by this constructor.
- Returns:
- class type list thrown by this constructor.
setThrows
public void setThrows(ClassTypeList ctlist)
- Sets the class type list thrown by this constructor.
- Parameters:
- ctlist - class type list thrown by this constructor.
getSpecialCallStatement
public SpecialCallStatement getSpecialCallStatement()
- Gets the special call statement.
Special call statement is like:
super();
- Returns:
- special call statement
setSpecialCallStatement
public void setSpecialCallStatement(SpecialCallStatement scstmt)
- Sets the special call statement.
- Parameters:
- scstmt - the special call statement to set
- See Also:
- getSpecialCallStatement
getBody
public StatementList getBody()
- Gets the statement list of this constructor body.
- Returns:
- the statement list of this constructor body.
setBody
public void setBody(StatementList stmts)
- Sets the statement list of this constructor body.
- Returns:
- the statement list of this constructor body.
make
public static ConstructorDeclaration make(String str)
All Packages Class Hierarchy This Package Previous Next Index