Top Description Methods
com.sun.source.tree

public Interface ImportTree

extends Tree
Known Direct Implementers
com.sun.tools.javac.tree.JCTree.JCImportBase
Imports
jdk.internal.javac.PreviewFeature

A tree node for an import declaration. For example:
  import qualifiedIdentifier ;

  import static qualifiedIdentifier ;
Authors
Peter von der Ahé, Jonathan Gibbons
Since
1.6
Java Language Specification
7.5 Import Declarations

Method Summary

Modifier and TypeMethod and Description
public Tree

Returns:

a qualified identifier, ending in "*" if and only if this is an import-on-demand
getQualifiedIdentifier
()

Returns the qualified identifier for the declaration(s) being imported.

public boolean

Returns:

true if this is an module import declaration.
isModule
()
Preview Preview of Module Import Declarations (JEP 476).

Returns true if this is an module import declaration.

public boolean

Returns:

true if this is a static import
isStatic
()

Returns true if this is a static import declaration.

Inherited from com.sun.source.tree.Tree:
acceptgetKind

Method Detail

getQualifiedIdentifierback to summary
public Tree getQualifiedIdentifier()

Returns the qualified identifier for the declaration(s) being imported. If this is an import-on-demand declaration, the qualified identifier will end in "*".

Returns:Tree

a qualified identifier, ending in "*" if and only if this is an import-on-demand

isModuleback to summary
public boolean isModule()

Preview

Preview of Module Import Declarations (JEP 476).

isModule is a reflective preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.

Returns true if this is an module import declaration.

Returns:boolean

true if this is an module import declaration.

Annotations
@PreviewFeature
feature:MODULE_IMPORTS
reflective:true
Since
23
isStaticback to summary
public boolean isStatic()

Returns true if this is a static import declaration.

Returns:boolean

true if this is a static import