public class TypeImportOnDemandDeclaration extends ImportDeclaration
import com.github.javaparser.*;
import com.github.javaparser.JavaParser.*;
Since a parser cannot differentiate between a type name and a package name, we simply store a NameExpr.
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION
Constructor and Description |
---|
TypeImportOnDemandDeclaration() |
TypeImportOnDemandDeclaration(Range range,
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.
|
NameExpr |
getName()
Retrieves the name of the import.
|
ImportDeclaration |
setName(NameExpr name)
Sets the name this import.
|
create
addOrphanComment, clone, contains, equals, getAllContainedComments, getBegin, getChildrenNodes, getComment, getEnd, getNodesByType, getOrphanComments, getParentNode, getParentNodeOfType, getRange, getUserData, hasComment, hashCode, isPositionedAfter, isPositionedBefore, remove, setAsParentNodeOf, setAsParentNodeOf, setBegin, setBlockComment, setComment, setEnd, setLineComment, setParentNode, setRange, setUserData, toString, toStringWithoutComments, tryAddImportToParentCompilationUnit
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Node
public <A> void accept(VoidVisitor<A> v, A arg)
Node
public NameExpr getName()
UnsupportedOperationException
- when invoked on an empty import declarationpublic ImportDeclaration setName(NameExpr name)
name
- the name to setCopyright © 2007–2016. All rights reserved.