All Packages Class Hierarchy This Package Previous Next Index
Class openjava.ptree.ConstructExpression
java.lang.Object
|
+----openjava.ptree.PtreeObject
|
+----openjava.ptree.NonLeaf
|
+----openjava.ptree.ConstructExpression
- public class ConstructExpression
- extends NonLeaf
- implements Expression
The ConstructExpression
class represents
an expression which allocates a new object with its constructor.
This expression is like:
new String( "test" )
or:
new String( "test" ){
public void hoge(){ ... }
...
}
The latter is supported from JDK 1.1, is called an anoymous class
of the inner class.
- See Also:
- Expression, ClassType, ExpressionList, MemberDeclarationList
-
ConstructExpression(ClassType, ExpressionList)
- Allocates a new object without class body.
-
ConstructExpression(ClassType, ExpressionList, MemberDeclarationList)
- Allocates a new object with the class body.
-
getArguments()
- Gets the arguments of this constructor.
-
getClassBody()
- Gets the class body of this constructor.
-
getClassType()
- Gets the class type of this constructor.
-
setArguments(ExpressionList)
- Sets the arguments of this constructor.
-
setClassBody(MemberDeclarationList)
- Sets the class body of this constructor.
-
setClassType(ClassType)
- Sets the class type of this constructor.
-
writeCode()
- Writes the code this parse-tree presents for.
ConstructExpression
public ConstructExpression(ClassType typename,
ExpressionList args,
MemberDeclarationList mdlst)
- Allocates a new object with the class body.
- Parameters:
- ctype - a class name to be constructed
- args - argument list of constructor
- mdlst - the class body.
If this is null, no class body will be provided
this construct expression with.
ConstructExpression
public ConstructExpression(ClassType ctype,
ExpressionList args)
- Allocates a new object without class body.
- Parameters:
- ctype - a class name to be constructed
- args - argument list of constructor
writeCode
public void writeCode()
- Writes the code this parse-tree presents for.
- Overrides:
- writeCode in class NonLeaf
getClassType
public ClassType getClassType()
- Gets the class type of this constructor.
- Returns:
- the class type of this constructor.
setClassType
public void setClassType(ClassType ctype)
- Sets the class type of this constructor.
- Parameters:
- ctype - the class body to set.
getArguments
public ExpressionList getArguments()
- Gets the arguments of this constructor.
- Returns:
- the arguments as an expressions list.
setArguments
public void setArguments(ExpressionList args)
- Sets the arguments of this constructor.
- Returns:
- the expressions list of arguments.
getClassBody
public MemberDeclarationList getClassBody()
- Gets the class body of this constructor.
- Returns:
- the member declaration list as the class body of
this constructor.
setClassBody
public void setClassBody(MemberDeclarationList mdlist)
- Sets the class body of this constructor.
- Parameters:
- mdlist - the member declaration list of the class body.
If this is null, the class body will disappear.
All Packages Class Hierarchy This Package Previous Next Index