public final class PackageDeclaration extends Node implements NodeWithAnnotations<PackageDeclaration>, NodeWithName<PackageDeclaration>
package com.github.javaparser.ast;
@Wonderful package anything.can.be.annotated.nowadays;Node.ObserverRegistrationModeABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration| Constructor and Description |
|---|
PackageDeclaration() |
PackageDeclaration(Name name) |
PackageDeclaration(NodeList<AnnotationExpr> annotations,
Name name) |
PackageDeclaration(Range range,
NodeList<AnnotationExpr> annotations,
Name 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.
|
NodeList<AnnotationExpr> |
getAnnotations()
Retrieves the list of annotations declared before the package
declaration.
|
Name |
getName()
Return the name expression of the package.
|
List<NodeList<?>> |
getNodeLists()
The list of NodeLists owned by this node.
|
PackageDeclaration |
setAnnotations(NodeList<AnnotationExpr> annotations) |
PackageDeclaration |
setName(Name name)
Sets the name of this package declaration.
|
addOrphanComment, clone, containsWithin, equals, getAllContainedComments, getBegin, getChildNodes, getComment, getData, getEnd, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getRange, hasComment, hashCode, hasJavaDocComment, isPositionedAfter, isPositionedBefore, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeOrphanComment, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setRange, toString, toString, tryAddImportToParentCompilationUnit, unregisterfinalize, getClass, notify, notifyAll, wait, wait, waitaddAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, isAnnotationPresent, isAnnotationPresent, setAnnotationgetNameAsString, setNamegetAncestorOfType, setAsParentNodeOf, setAsParentNodeOfpublic PackageDeclaration()
public PackageDeclaration(Name name)
public PackageDeclaration(NodeList<AnnotationExpr> annotations, Name name)
public PackageDeclaration(Range range, NodeList<AnnotationExpr> annotations, Name name)
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Visitableaccept in interface VisitableR - the type of the return value of the visitorA - the type the user argument passed to the visitorv - the visitor implementationarg - the argument passed to the visitor (of type A)public <A> void accept(VoidVisitor<A> v, A arg)
Visitablepublic NodeList<AnnotationExpr> getAnnotations()
null if there are no annotations.getAnnotations in interface NodeWithAnnotations<PackageDeclaration>nullpublic Name getName()
getName in interface NodeWithName<PackageDeclaration>public PackageDeclaration setAnnotations(NodeList<AnnotationExpr> annotations)
setAnnotations in interface NodeWithAnnotations<PackageDeclaration>annotations - the annotations to setpublic PackageDeclaration setName(Name name)
setName in interface NodeWithName<PackageDeclaration>name - the name to setpublic List<NodeList<?>> getNodeLists()
NodegetNodeLists in class NodeCopyright © 2007–2017. All rights reserved.