|
RECODER 0.92 | |||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectrecoder.java.JavaSourceElement
recoder.java.JavaProgramElement
recoder.java.JavaNonTerminalProgramElement
recoder.java.declaration.JavaDeclaration
recoder.java.declaration.TypeDeclaration
recoder.java.declaration.ClassDeclaration
public class ClassDeclaration
Outer or member class declaration. There are several types of class declarations:
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface recoder.java.ProgramElement |
|---|
ProgramElement.TreeStructure |
| Nested classes/interfaces inherited from interface recoder.java.SourceElement |
|---|
SourceElement.Position |
| Nested classes/interfaces inherited from interface recoder.abstraction.ProgramModelElement |
|---|
ProgramModelElement.LexicalOrder |
| Nested classes/interfaces inherited from interface recoder.abstraction.ProgramModelElement |
|---|
ProgramModelElement.LexicalOrder |
| Nested classes/interfaces inherited from interface recoder.abstraction.ProgramModelElement |
|---|
ProgramModelElement.LexicalOrder |
| Field Summary |
|---|
| Fields inherited from class recoder.java.declaration.TypeDeclaration |
|---|
name2field, name2type |
| Fields inherited from class recoder.java.JavaSourceElement |
|---|
factory |
| Fields inherited from interface recoder.java.ProgramElement |
|---|
STRUCTURAL_EQUALITY, STRUCTURAL_HASH_CODE |
| Fields inherited from interface recoder.abstraction.ProgramModelElement |
|---|
LEXICAL_ORDER |
| Fields inherited from interface recoder.bytecode.AccessFlags |
|---|
ABSTRACT, ANNOTATION, BRIDGE, ENUM, FINAL, INTERFACE, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICT, SUPER, SYNCHRONIZED, SYNTHETIC, TRANSIENT, VARARGS, VOLATILE |
| Fields inherited from interface recoder.abstraction.ProgramModelElement |
|---|
LEXICAL_ORDER |
| Fields inherited from interface recoder.bytecode.AccessFlags |
|---|
ABSTRACT, ANNOTATION, BRIDGE, ENUM, FINAL, INTERFACE, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICT, SUPER, SYNCHRONIZED, SYNTHETIC, TRANSIENT, VARARGS, VOLATILE |
| Fields inherited from interface recoder.abstraction.ProgramModelElement |
|---|
LEXICAL_ORDER |
| Fields inherited from interface recoder.bytecode.AccessFlags |
|---|
ABSTRACT, ANNOTATION, BRIDGE, ENUM, FINAL, INTERFACE, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICT, SUPER, SYNCHRONIZED, SYNTHETIC, TRANSIENT, VARARGS, VOLATILE |
| Constructor Summary | |
|---|---|
|
ClassDeclaration()
Class declaration. |
|
ClassDeclaration(ASTList<DeclarationSpecifier> declSpecs,
Identifier name,
Extends extended,
Implements implemented,
ASTList<MemberDeclaration> members)
|
|
ClassDeclaration(ASTList<DeclarationSpecifier> declSpecs,
Identifier name,
Extends extended,
Implements implemented,
ASTList<MemberDeclaration> members,
ASTList<TypeParameterDeclaration> typeParameters)
Construct a non-anonymous class. |
|
ClassDeclaration(ASTList<MemberDeclaration> members)
Class declaration. |
protected |
ClassDeclaration(ClassDeclaration proto)
Class declaration. |
| Method Summary | |
|---|---|
void |
accept(SourceVisitor v)
Receive a visitor, for instance a pretty printer. |
ClassDeclaration |
deepClone()
Deep clone. |
ProgramElement |
getChildAt(int index)
Returns the child at the specified index in this node's "virtual" child array |
int |
getChildCount()
Returns the number of children of this node. |
int |
getChildPositionCode(ProgramElement child)
Returns the positional code of the given child, or -1 if
there is no such child. |
Extends |
getExtendedTypes()
Get extended types. |
Implements |
getImplementedTypes()
Get implemented types. |
StatementContainer |
getStatementContainer()
Get statement container. |
ASTList<TypeParameterDeclaration> |
getTypeParameters()
Returns the type parameters of this class type. |
boolean |
isAnnotationType()
Checks if this class type denotes an annotation type |
boolean |
isEnumType()
Checks if this class type denotes an enum type |
boolean |
isInner()
Checks if this type is an inner class, as described in JLS, 3rd edition, §8.1.3 |
boolean |
isInterface()
Checks if this class type denotes an interface (i.e. ordinary interface or annotation type). |
boolean |
isOrdinaryClass()
Checks if this class type denotes an ordinary (i.e. not an enum) class. |
boolean |
isOrdinaryInterface()
Checks if this class type denotes an ordinary (i.e. not annotation type) interface. |
boolean |
isStrictFp()
Classes are never strictfp. |
boolean |
isTransient()
Classes are never transient. |
boolean |
isVolatile()
Classes are never volatile. |
void |
makeParentRoleValid()
Make parent role valid. |
boolean |
replaceChild(ProgramElement p,
ProgramElement q)
Replace a single child in the current node. |
void |
setExtendedTypes(Extends spec)
Set extended types. |
void |
setImplementedTypes(Implements spec)
Set implemented types. |
void |
setStatementContainer(StatementContainer p)
Set statement container. |
void |
setTypeParameters(ASTList<TypeParameterDeclaration> typeParameters)
|
| Methods inherited from class recoder.java.declaration.JavaDeclaration |
|---|
getAnnotations, getDeclarationSpecifiers, getModifiers, getVisibilityModifier, isNative, isSynchronized, setDeclarationSpecifiers |
| Methods inherited from class recoder.java.JavaNonTerminalProgramElement |
|---|
getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll |
| Methods inherited from class recoder.java.JavaProgramElement |
|---|
getComments, getID, setComments, validate |
| Methods inherited from class recoder.java.JavaSourceElement |
|---|
getEndPosition, getFactory, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface recoder.java.ProgramElement |
|---|
getASTParent, getComments, getID, setComments |
| Methods inherited from interface recoder.java.SourceElement |
|---|
getEndPosition, getFactory, getFirstElement, getLastElement, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource |
| Methods inherited from interface recoder.ModelElement |
|---|
validate |
| Methods inherited from interface recoder.java.NonTerminalProgramElement |
|---|
getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll |
| Methods inherited from interface recoder.java.Declaration |
|---|
getDeclarationSpecifiers, setDeclarationSpecifiers |
| Methods inherited from interface recoder.java.NonTerminalProgramElement |
|---|
getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll |
| Methods inherited from interface recoder.abstraction.Member |
|---|
getAnnotations |
| Methods inherited from interface recoder.java.NonTerminalProgramElement |
|---|
getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll |
| Methods inherited from interface recoder.java.NonTerminalProgramElement |
|---|
getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll |
| Constructor Detail |
|---|
public ClassDeclaration()
public ClassDeclaration(ASTList<DeclarationSpecifier> declSpecs,
Identifier name,
Extends extended,
Implements implemented,
ASTList<MemberDeclaration> members,
ASTList<TypeParameterDeclaration> typeParameters)
public ClassDeclaration(ASTList<DeclarationSpecifier> declSpecs,
Identifier name,
Extends extended,
Implements implemented,
ASTList<MemberDeclaration> members)
public ClassDeclaration(ASTList<MemberDeclaration> members)
members - a member declaration mutable list.protected ClassDeclaration(ClassDeclaration proto)
proto - a class declaration.| Method Detail |
|---|
public ClassDeclaration deepClone()
deepClone in interface SourceElementdeepClone in interface StatementdeepClone in class TypeDeclarationpublic void makeParentRoleValid()
makeParentRoleValid in interface NonTerminalProgramElementmakeParentRoleValid in class TypeDeclarationpublic int getChildCount()
getChildCount in interface NonTerminalProgramElementpublic ProgramElement getChildAt(int index)
getChildAt in interface NonTerminalProgramElementindex - an index into this node's "virtual" child array
java.lang.ArrayIndexOutOfBoundsException - if index is out of boundspublic int getChildPositionCode(ProgramElement child)
NonTerminalProgramElement-1 if
there is no such child. The result contains an encoding of the relative
position of the child as well as the role it has been playing in this
parent element. This information is required internally for proper undo
of transformations and is to be delivered to the detached method of the
ChangeHistory.
getChildPositionCode in interface NonTerminalProgramElementchild - the exact child to look for.
-1.ChangeHistory.detached(recoder.java.ProgramElement, recoder.java.NonTerminalProgramElement, int)
public boolean replaceChild(ProgramElement p,
ProgramElement q)
replaceChild in interface NonTerminalProgramElementp - the old child.p - the new child.
java.lang.ClassCastException - if the new child cannot take over the role of the old one.public StatementContainer getStatementContainer()
getStatementContainer in interface Statementpublic void setStatementContainer(StatementContainer p)
StatementBlock.
setStatementContainer in interface Statementp - a statement container.public Extends getExtendedTypes()
public void setExtendedTypes(Extends spec)
spec - an extends.public Implements getImplementedTypes()
public void setImplementedTypes(Implements spec)
spec - an implements.public boolean isStrictFp()
isStrictFp in interface MemberisStrictFp in interface MemberDeclarationisStrictFp in class TypeDeclarationtrue if this member is strictfp, false
otherwise.public boolean isTransient()
isTransient in class JavaDeclarationpublic boolean isVolatile()
isVolatile in class JavaDeclarationpublic boolean isInterface()
ClassType
isInterface in interface ClassTypeisInterface in class TypeDeclarationtrue if this object represents an interface,
false otherwise.public boolean isOrdinaryInterface()
ClassType
isOrdinaryInterface in interface ClassTypetrue if this object represents an ordinary interface,
false otherwise.public boolean isAnnotationType()
ClassType
isAnnotationType in interface ClassTypetrue if this object represents an annotation type,
false otherwisepublic boolean isEnumType()
ClassType
isEnumType in interface ClassTypetrue if this object represents an enum type,
false otherwisepublic boolean isOrdinaryClass()
ClassType
isOrdinaryClass in interface ClassTypetrue if this object represents an ordinary class type,
false otherwisepublic void accept(SourceVisitor v)
SourceElement
accept in interface SourceElementv - a source visitor.public void setTypeParameters(ASTList<TypeParameterDeclaration> typeParameters)
public ASTList<TypeParameterDeclaration> getTypeParameters()
ClassType
getTypeParameters in interface ClassTypegetTypeParameters in class TypeDeclarationpublic boolean isInner()
ClassType
isInner in interface ClassType
|
RECODER 0.92 | |||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||