public final class PackageDeclaration extends Node
This class represents the package declaration. The package declaration is
optional for the CompilationUnit
.
PackageDeclaration ::= (
AnnotationExpr
)* "package"
NameExpr
) ";"
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE
Constructor and Description |
---|
PackageDeclaration() |
PackageDeclaration(int beginLine,
int beginColumn,
int endLine,
int endColumn,
java.util.List<AnnotationExpr> annotations,
NameExpr name) |
PackageDeclaration(java.util.List<AnnotationExpr> annotations,
NameExpr name) |
PackageDeclaration(NameExpr name) |
Modifier and Type | Method and Description |
---|---|
<R,A> R |
accept(GenericVisitor<R,A> v,
A arg)
Accept method for visitor support.
|
<A> void |
accept(VoidVisitor<A> v,
A arg)
Accept method for visitor support.
|
java.util.List<AnnotationExpr> |
getAnnotations()
Retrieves the list of annotations declared before the package
declaration.
|
NameExpr |
getName()
Return the name of the package.
|
void |
setAnnotations(java.util.List<AnnotationExpr> annotations) |
void |
setName(NameExpr name)
Sets the name of this package declaration.
|
addOrphanComment, contains, equals, getAllContainedComments, getBeginColumn, getBeginLine, getChildrenNodes, getComment, getData, getEndColumn, getEndLine, getOrphanComments, getParentNode, hasComment, hashCode, isPositionedAfter, isPositionedBefore, setAsParentNodeOf, setAsParentNodeOf, setBeginColumn, setBeginLine, setComment, setData, setEndColumn, setEndLine, setParentNode, toString, toStringWithoutComments
public PackageDeclaration()
public PackageDeclaration(NameExpr name)
public PackageDeclaration(java.util.List<AnnotationExpr> annotations, NameExpr name)
public PackageDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, java.util.List<AnnotationExpr> annotations, NameExpr name)
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Node
public <A> void accept(VoidVisitor<A> v, A arg)
Node
public java.util.List<AnnotationExpr> getAnnotations()
null
if there are no annotations.null
public NameExpr getName()
public void setAnnotations(java.util.List<AnnotationExpr> annotations)
annotations
- the annotations to setpublic void setName(NameExpr name)
name
- the name to setCopyright © 2007-2015. All Rights Reserved.