|
Eclipse JDT Release 3.7 |
|||||||||
| 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 (element type: Annotation) (added in JLS3 API). |
static ChildPropertyDescriptor |
JAVADOC_PROPERTY
The "javadoc" structural property of this node type (child type: Javadoc). |
static ChildPropertyDescriptor |
NAME_PROPERTY
The "name" structural property of this node type (child type: Name). |
| Method Summary | |
|---|---|
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 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 |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final ChildPropertyDescriptor JAVADOC_PROPERTY
Javadoc).
public static final ChildListPropertyDescriptor ANNOTATIONS_PROPERTY
Annotation) (added in JLS3 API).
public static final ChildPropertyDescriptor NAME_PROPERTY
Name).
| Method Detail |
|---|
public static List propertyDescriptors(int apiLevel)
apiLevel - the API level; one of the
AST.JLS* constants
StructuralPropertyDescriptor)public List annotations()
Annotation)
UnsupportedOperationException - if this operation is used in
a JLS2 ASTpublic Javadoc getJavadoc()
null if none
UnsupportedOperationException - if this operation is used in
a JLS2 ASTpublic void setJavadoc(Javadoc docComment)
docComment - the doc comment node, or null if none
IllegalArgumentException - if the doc comment string is invalid
UnsupportedOperationException - if this operation is used in
a JLS2 ASTpublic Name getName()
public void setName(Name name)
name - the new package name
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
|
Eclipse JDT Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) 2000, 2011 IBM Corporation and others. All rights reserved.