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

Constructor Index

 o ConstructExpression(ClassType, ExpressionList)
Allocates a new object without class body.
 o ConstructExpression(ClassType, ExpressionList, MemberDeclarationList)
Allocates a new object with the class body.

Method Index

 o getArguments()
Gets the arguments of this constructor.
 o getClassBody()
Gets the class body of this constructor.
 o getClassType()
Gets the class type of this constructor.
 o setArguments(ExpressionList)
Sets the arguments of this constructor.
 o setClassBody(MemberDeclarationList)
Sets the class body of this constructor.
 o setClassType(ClassType)
Sets the class type of this constructor.
 o writeCode()
Writes the code this parse-tree presents for.

Constructors

 o 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.
 o 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

Methods

 o writeCode
 public void writeCode()
Writes the code this parse-tree presents for.

Overrides:
writeCode in class NonLeaf
 o getClassType
 public ClassType getClassType()
Gets the class type of this constructor.

Returns:
the class type of this constructor.
 o setClassType
 public void setClassType(ClassType ctype)
Sets the class type of this constructor.

Parameters:
ctype - the class body to set.
 o getArguments
 public ExpressionList getArguments()
Gets the arguments of this constructor.

Returns:
the arguments as an expressions list.
 o setArguments
 public void setArguments(ExpressionList args)
Sets the arguments of this constructor.

Returns:
the expressions list of arguments.
 o getClassBody
 public MemberDeclarationList getClassBody()
Gets the class body of this constructor.

Returns:
the member declaration list as the class body of this constructor.
 o 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