|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.core.dom.ASTNode
org.eclipse.jdt.core.dom.BodyDeclaration
public abstract class BodyDeclaration
Abstract base class of all AST nodes that represent body declarations that may appear in the body of some kind of class or interface declaration, including anonymous class declarations, enumeration declarations, and enumeration constant declarations.
For JLS2:
BodyDeclaration: ClassDeclaration InterfaceDeclaration MethodDeclaration ConstructorDeclaration FieldDeclaration InitializerFor JLS3, a number of new node types were introduced:
BodyDeclaration: ClassDeclaration InterfaceDeclaration EnumDeclaration MethodDeclaration ConstructorDeclaration FieldDeclaration Initializer EnumConstantDeclaration AnnotationTypeDeclaration AnnotationTypeMemberDeclaration
All types of body declarations carry modifiers (and annotations), although they differ in which modifiers are allowed. Most types of body declarations can carry a doc comment; Initializer is the only ones that does not. The source range for body declarations always includes the doc comment if present.
Field Summary |
---|
Method Summary | |
---|---|
Javadoc |
getJavadoc()
Returns the doc comment node. |
ChildPropertyDescriptor |
getJavadocProperty()
Returns structural property descriptor for the "javadoc" property of this node. |
int |
getModifiers()
Returns the modifiers explicitly specified on this declaration. |
ChildListPropertyDescriptor |
getModifiersProperty()
Returns structural property descriptor for the "modifiers" property of this node as used in JLS3. |
java.util.List |
modifiers()
Returns the live ordered list of modifiers and annotations of this declaration (added in JLS3 API). |
void |
setJavadoc(Javadoc docComment)
Sets or clears the doc comment node. |
void |
setModifiers(int modifiers)
Deprecated. In the JLS3 API, this method is replaced by modifiers() which contains a list of a Modifier nodes. |
Methods inherited from class org.eclipse.jdt.core.dom.ASTNode |
---|
accept, copySubtree, copySubtrees, delete, equals, getAST, getFlags, getLength, getLocationInParent, getNodeType, getParent, getProperty, getRoot, getStartPosition, getStructuralProperty, hashCode, nodeClassForType, properties, setFlags, setProperty, setSourceRange, setStructuralProperty, structuralPropertiesForType, subtreeBytes, subtreeMatch, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public final ChildListPropertyDescriptor getModifiersProperty()
public final ChildPropertyDescriptor getJavadocProperty()
public Javadoc getJavadoc()
null
if nonepublic void setJavadoc(Javadoc docComment)
docComment
- the doc comment node, or null
if none
java.lang.IllegalArgumentException
- if the doc comment string is invalidpublic int getModifiers()
In the JLS3 API, this method is a convenience method that
computes these flags from modifiers()
.
Modifier
constantsModifier
public void setModifiers(int modifiers)
modifiers()
which contains a list of a Modifier
nodes.
modifiers
- the given modifiers (bit-wise or of Modifier
constants)
java.lang.UnsupportedOperationException
- if this operation is used in
an AST later than JLS2Modifier
public java.util.List modifiers()
IExtendedModifier
)
java.lang.UnsupportedOperationException
- if this operation is used in
a JLS2 AST
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |