|
||||||||||
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.ClassDeclaration
The ClassDeclaration class presents class declaration node of parse tree.
ParseTree
,
NonLeaf
Field Summary | |
private boolean |
_isInterface
|
private String[] |
metaclazz
|
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 | |
ClassDeclaration(ModifierList modiflist,
String name,
TypeName[] baseclasses,
TypeName[] ifaces,
MemberDeclarationList fieldlist)
Constructs ClassDeclaration from its elements. |
|
ClassDeclaration(ModifierList modiflist,
String name,
TypeName[] baseclasses,
TypeName[] ifaces,
MemberDeclarationList fieldlist,
boolean is_class)
|
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. |
TypeName |
getBaseclass()
Gets base classes in 'extends' clause. |
TypeName[] |
getBaseclasses()
Gets the classes in 'extends' clause. |
MemberDeclarationList |
getBody()
Gets class body |
TypeName[] |
getInterfaces()
Gets interface name list |
String |
getMetaclass()
|
ModifierList |
getModifiers()
Gets modifier list |
String |
getName()
Gets the class name. |
Hashtable |
getSuffixes()
|
boolean |
isInterface()
|
void |
setBaseclass(TypeName ctype)
Sets super class name |
void |
setBaseclasses(TypeName[] ctypes)
Sets super class name |
void |
setBody(MemberDeclarationList mdlist)
Sets class body |
void |
setInterfaces(TypeName[] ctlist)
Sets interface name list |
void |
setMetaclass(String metaclazz)
|
void |
setMetaclass(String[] metaclazz)
|
void |
setModifiers(ModifierList modifs)
Sets modifier list |
void |
setName(String name)
Sets a class name in extends clause. |
void |
setSuffixes(Hashtable suffixes)
|
void |
writeCode()
write object code ModifierList "class" Identifier "extends" TypeName "implements" TypeNameList MemberDeclarationList |
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.ParseTree |
childrenAccept, eq, equals, getObjectID, makeCopy, makeRecursiveCopy, replace, toFlattenString, toString |
Methods inherited from interface openjava.ptree.MemberDeclaration |
eq, equals |
Field Detail |
private String[] metaclazz
private Hashtable suffixes
private boolean _isInterface
Constructor Detail |
public ClassDeclaration(ModifierList modiflist, String name, TypeName[] baseclasses, TypeName[] ifaces, MemberDeclarationList fieldlist)
modiflist
- modifier listname
- class namefieldlist
- field declaration list (body of new class)public ClassDeclaration(ModifierList modiflist, String name, TypeName[] baseclasses, TypeName[] ifaces, MemberDeclarationList fieldlist, boolean is_class)
Method Detail |
public void writeCode()
writeCode
in interface ParseTree
writeCode
in class NonLeaf
public boolean isInterface()
public ModifierList getModifiers()
public void setModifiers(ModifierList modifs)
modifs
- modifiers to setpublic String getName()
public void setName(String name)
name
- name to setpublic TypeName[] getBaseclasses()
public TypeName getBaseclass()
public void setBaseclasses(TypeName[] ctypes)
ctypes
- class types to setpublic void setBaseclass(TypeName ctype)
ctype
- class type to setpublic TypeName[] getInterfaces()
public void setInterfaces(TypeName[] ctlist)
ctlist
- class type list to setpublic MemberDeclarationList getBody()
public void setBody(MemberDeclarationList mdlist)
public void setSuffixes(Hashtable suffixes)
public Hashtable getSuffixes()
public void setMetaclass(String metaclazz)
public void setMetaclass(String[] metaclazz)
public String getMetaclass()
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 |