public abstract class ImportDeclaration extends Node
This class is a base class for classes representing import declarations. Imports are optional for the
CompilationUnit
.
An EmptyImportDeclaration is simply a semicolon among the import declarations.ImportDeclaration ::= "import" ( "static" )?
NameExpr
( "." "*" )? ";"
Node.ObserverRegistrationMode
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration
Constructor and Description |
---|
ImportDeclaration() |
ImportDeclaration(Range range) |
Modifier and Type | Method and Description |
---|---|
static ImportDeclaration |
create(Range range,
Name name,
boolean isStatic,
boolean isAsterisk)
Factory method for import declarations.
|
addOrphanComment, clone, containsWithin, equals, getAllContainedComments, getBegin, getChildNodes, getComment, getData, getEnd, getNodeLists, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getRange, hasComment, hashCode, isPositionedAfter, isPositionedBefore, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, setAsParentNodeOf, setBegin, setBlockComment, setComment, setData, setEnd, setLineComment, setParentNode, setRange, toString, toString, tryAddImportToParentCompilationUnit, unregister
finalize, getClass, notify, notifyAll, wait, wait, wait
getAncestorOfType, setAsParentNodeOf, setAsParentNodeOf
public ImportDeclaration()
public ImportDeclaration(Range range)
public static ImportDeclaration create(Range range, Name name, boolean isStatic, boolean isAsterisk)
range
- the range the import declaration covers. Range.UNKNOWN if not known.name
- the qualified name of the import.isStatic
- whether the import is static.isAsterisk
- whether the import is on demand.Copyright © 2007–2016. All rights reserved.