|
||||||||||
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.PackageDeclaration
public class PackageDeclaration
Package declaration AST node type. For JLS2:
PackageDeclaration: package Name ;For JLS3, annotations and doc comment were added:
PackageDeclaration: [ Javadoc ] { Annotation } package Name ;Note that the standard AST parser only recognizes a Javadoc comment immediately preceding the package declaration when it occurs in the special
package-info.java
compilation unit (JLS3 7.4.1.1).
The Javadoc comment in that file contains the package description.
Field Summary | |
---|---|
static ChildListPropertyDescriptor |
ANNOTATIONS_PROPERTY
The "annotations" structural property of this node type (added in JLS3 API). |
static ChildPropertyDescriptor |
JAVADOC_PROPERTY
The "javadoc" structural property of this node type. |
static ChildPropertyDescriptor |
NAME_PROPERTY
The "name" structural property of this node type. |
Method Summary | |
---|---|
java.util.List |
annotations()
Returns the live ordered list of annotations of this package declaration (added in JLS3 API). |
Javadoc |
getJavadoc()
Returns the doc comment node. |
Name |
getName()
Returns the package name of this package declaration. |
static java.util.List |
propertyDescriptors(int apiLevel)
Returns a list of structural property descriptors for this node type. |
IPackageBinding |
resolveBinding()
Resolves and returns the binding for the package declared in this package declaration. |
void |
setJavadoc(Javadoc docComment)
Sets or clears the doc comment node. |
void |
setName(Name name)
Sets the package name of this package declaration to the given name. |
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 |
Field Detail |
---|
public static final ChildPropertyDescriptor JAVADOC_PROPERTY
public static final ChildListPropertyDescriptor ANNOTATIONS_PROPERTY
public static final ChildPropertyDescriptor NAME_PROPERTY
Method Detail |
---|
public static java.util.List propertyDescriptors(int apiLevel)
apiLevel
- the API level; one of the
AST.JLS*
constants
StructuralPropertyDescriptor
)public java.util.List annotations()
Annotation
)
java.lang.UnsupportedOperationException
- if this operation is used in
a JLS2 ASTpublic Javadoc getJavadoc()
null
if none
java.lang.UnsupportedOperationException
- if this operation is used in
a JLS2 ASTpublic void setJavadoc(Javadoc docComment)
docComment
- the doc comment node, or null
if none
java.lang.IllegalArgumentException
- if the doc comment string is invalid
java.lang.UnsupportedOperationException
- if this operation is used in
a JLS2 ASTpublic Name getName()
public void setName(Name name)
name
- the new package name
java.lang.IllegalArgumentException
- if`:
public IPackageBinding resolveBinding()
Note that bindings are generally unavailable unless requested when the AST is being built.
null
if the binding cannot be
resolved
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |