|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.ptree.ParseTreeObject | +--openjava.ptree.NonLeaf | +--openjava.ptree.ClassDeclaration
The ClassDeclaration class presents class declaraton node of parse tree.
ParseTree
,
NonLeaf
,
openjava.ptree.TypeDeclaration
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,
java.lang.String name,
TypeName[] baseclasses,
TypeName[] ifaces,
MemberDeclarationList fieldlist)
Constructs ClassDeclaration from its elements. |
|
ClassDeclaration(ModifierList modiflist,
java.lang.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 |
java.lang.String |
getMetaclass()
|
ModifierList |
getModifiers()
Gets modifier list |
java.lang.String |
getName()
Gets the class name. |
java.util.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(java.lang.String metaclazz)
|
void |
setMetaclass(java.lang.String[] metaclazz)
|
void |
setModifiers(ModifierList modifs)
Sets modifier list |
void |
setName(java.lang.String name)
Sets a class name in extends clause. |
void |
setSuffixes(java.util.Hashtable suffixes)
|
void |
writeCode()
write object code ModifierList "class" Identifier "extends" TypeName "implements" TypeNameList MemberDeclarationList |
Methods inherited from class openjava.ptree.NonLeaf |
childrenAccept,
elementAt,
equals,
getComment,
getContents,
getLength,
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 |
Constructor Detail |
public ClassDeclaration(ModifierList modiflist, java.lang.String name, TypeName[] baseclasses, TypeName[] ifaces, MemberDeclarationList fieldlist)
modiflist
- modifier listname
- class namezuper
- arg zuper is null means class decl has no super classinterfacelist
- if class decl has no implemants,
arg interfacelist should be set an empty listfieldlist
- field declaration list (body of new class)public ClassDeclaration(ModifierList modiflist, java.lang.String name, TypeName[] baseclasses, TypeName[] ifaces, MemberDeclarationList fieldlist, boolean is_class)
Method Detail |
public void writeCode()
public boolean isInterface()
public ModifierList getModifiers()
public void setModifiers(ModifierList modifs)
modifs
- modifiers to setpublic java.lang.String getName()
public void setName(java.lang.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)
body
- member declaration list to set as this class body.public void setSuffixes(java.util.Hashtable suffixes)
public java.util.Hashtable getSuffixes()
public void setMetaclass(java.lang.String metaclazz)
public void setMetaclass(java.lang.String[] metaclazz)
public java.lang.String getMetaclass()
public void accept(ParseTreeVisitor v) throws ParseTreeException
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.
visitor
- a visitor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |