All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class openjava.ptree.ClassDeclaration

java.lang.Object
   |
   +----openjava.ptree.PtreeObject
           |
           +----openjava.ptree.NonLeaf
                   |
                   +----openjava.ptree.ClassDeclaration

public class ClassDeclaration
extends NonLeaf
implements TypeDeclaration
The ClassDeclaration class presents class declaraton node of parse tree.

See Also:
Ptree, NonLeaf, TypeDeclaration

Constructor Index

 o ClassDeclaration(ModifierList, Identifier, ClassType, ClassTypeList, MemberDeclarationList)
Constructs ClassDeclaration from its elements.

Method Index

 o getBody()
Gets class body
 o getInterfaces()
Gets interface name list
 o getMetaclass()
 o getModifiers()
Gets modifier list
 o getName()
Gets class name
 o getSuper()
Gets super class name
 o getUserDecorators()
 o setBody(MemberDeclarationList)
Sets class body
 o setInterfaces(ClassTypeList)
Sets interface name list
 o setMetaclass(Class)
 o setModifiers(ModifierList)
Sets modifier list
 o setName(Identifier)
Sets class name
 o setSuper(ClassType)
Sets super class name
 o setUserDecorators(UserDecoratorList)
 o writeCode()
write object code ModifierList "class" Identifier "extends" ClassType "implements" ClassTypeList MemberDeclarationList

Constructors

 o ClassDeclaration
 public ClassDeclaration(ModifierList modiflist,
                         Identifier name,
                         ClassType zuper,
                         ClassTypeList interfacelist,
                         MemberDeclarationList fieldlist)
Constructs ClassDeclaration from its elements.

Parameters:
modiflist - modifier list
name - class name
zuper - arg zuper is null means class decl has no super class
interfacelist - if class decl has no implemants, arg interfacelist should be set an empty list
fieldlist - field declaration list (body of new class)

Methods

 o writeCode
 public void writeCode()
write object code ModifierList "class" Identifier "extends" ClassType "implements" ClassTypeList MemberDeclarationList

Overrides:
writeCode in class NonLeaf
 o getModifiers
 public ModifierList getModifiers()
Gets modifier list

Returns:
there is no modifiers, getModifierList returns an empty list.
 o setModifiers
 public void setModifiers(ModifierList modifs)
Sets modifier list

Parameters:
modifs - modifiers to set
 o getName
 public Identifier getName()
Gets class name

Returns:
class name
 o setName
 public void setName(Identifier name)
Sets class name

Parameters:
name - name to set
 o getSuper
 public ClassType getSuper()
Gets super class name

Returns:
if class decl has no extends, this returns null otherwise returns the name of the super class.
 o setSuper
 public void setSuper(ClassType ct)
Sets super class name

Parameters:
ct - class type to set
 o getInterfaces
 public ClassTypeList getInterfaces()
Gets interface name list

Returns:
there is no implemented class, getInterfaceList returns an empty list
 o setInterfaces
 public void setInterfaces(ClassTypeList ctlist)
Sets interface name list

Parameters:
ctlist - class type list to set
 o getBody
 public MemberDeclarationList getBody()
Gets class body

Returns:
return an field declaration list as this class body.
 o setBody
 public void setBody(MemberDeclarationList mdlist)
Sets class body

Parameters:
body - member declaration list to set as this class body.
 o getUserDecorators
 public UserDecoratorList getUserDecorators()
 o setUserDecorators
 public void setUserDecorators(UserDecoratorList ud)
 o setMetaclass
 public void setMetaclass(Class metaclazz)
 o getMetaclass
 public Class getMetaclass()

All Packages  Class Hierarchy  This Package  Previous  Next  Index