| Package | Description |
|---|---|
| com.github.javaparser | |
| com.github.javaparser.ast | |
| com.github.javaparser.ast.imports |
| Modifier and Type | Field and Description |
|---|---|
static ParseStart<ImportDeclaration> |
ParseStart.IMPORT_DECLARATION |
| Modifier and Type | Method and Description |
|---|---|
static ImportDeclaration |
JavaParser.parseImport(String importDeclaration)
Parses the Java import contained in a
String and returns a
ImportDeclaration that represents it. |
| Modifier and Type | Method and Description |
|---|---|
ImportDeclaration |
CompilationUnit.getImport(int i) |
| Modifier and Type | Method and Description |
|---|---|
NodeList<ImportDeclaration> |
CompilationUnit.getImports()
Retrieves the list of imports declared in this compilation unit or
null if there is no import. |
| Modifier and Type | Method and Description |
|---|---|
CompilationUnit |
CompilationUnit.setImports(NodeList<ImportDeclaration> imports)
Sets the list of imports of this compilation unit.
|
| Constructor and Description |
|---|
CompilationUnit(PackageDeclaration pakage,
NodeList<ImportDeclaration> imports,
NodeList<TypeDeclaration<?>> types) |
CompilationUnit(Range range,
PackageDeclaration pakage,
NodeList<ImportDeclaration> imports,
NodeList<TypeDeclaration<?>> types) |
| Modifier and Type | Class and Description |
|---|---|
class |
EmptyImportDeclaration
A stray semicolon between the imports.
|
class |
NonEmptyImportDeclaration
Common ancestor for all imports, aside EmptyImportDeclaration
|
class |
SingleStaticImportDeclaration
Example:
import static com.github.javaparser.JavaParser.parse;
In the example, "com.github.javaparser.JavaParser" is the type,
and "parse" is the staticMember. |
class |
SingleTypeImportDeclaration
Example:
import com.github.javaparser.JavaParser; |
class |
StaticImportOnDemandDeclaration
Example:
import static com.github.javaparser.JavaParser.*; |
class |
TypeImportOnDemandDeclaration
Examples:
import com.github.javaparser.*;
import com.github.javaparser.JavaParser.*;
Since a parser cannot differentiate between a type name and a package name, we can only store a Name. |
| Modifier and Type | Method and Description |
|---|---|
static ImportDeclaration |
ImportDeclaration.create(Range range,
Name name,
boolean isStatic,
boolean isAsterisk)
Factory method for import declarations.
|
Copyright © 2007–2016. All rights reserved.