Package org.sonar.java.model
Class JavaTree.CompilationUnitTreeImpl
- java.lang.Object
-
- org.sonar.java.model.JavaTree
-
- org.sonar.java.model.JavaTree.CompilationUnitTreeImpl
-
- All Implemented Interfaces:
CompilationUnitTree
,Tree
- Enclosing class:
- JavaTree
public static class JavaTree.CompilationUnitTreeImpl extends JavaTree implements CompilationUnitTree
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.sonar.java.model.JavaTree
JavaTree.AnnotatedTypeTree, JavaTree.ArrayTypeTreeImpl, JavaTree.CompilationUnitTreeImpl, JavaTree.ImportTreeImpl, JavaTree.NotImplementedTreeImpl, JavaTree.PackageDeclarationTreeImpl, JavaTree.ParameterizedTypeTreeImpl, JavaTree.PrimitiveTypeTreeImpl, JavaTree.UnionTypeTreeImpl, JavaTree.WildcardTreeImpl
-
-
Constructor Summary
Constructors Constructor Description CompilationUnitTreeImpl(PackageDeclarationTree packageDeclaration, List<ImportClauseTree> imports, List<Tree> types, ModuleDeclarationTree moduleDeclaration, SyntaxToken eofToken)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(TreeVisitor visitor)
Iterable<Tree>
children()
Creates iterable for children of this node.SyntaxToken
eofToken()
List<ImportClauseTree>
imports()
Tree.Kind
kind()
ModuleDeclarationTree
moduleDeclaration()
Experimental feature allowing retrieval of java 9 module declaration from 'module-info.java' files.PackageDeclarationTree
packageDeclaration()
List<Tree>
types()
-
Methods inherited from class org.sonar.java.model.JavaTree
firstToken, getChildren, getLine, is, isLeaf, lastToken, parent, setParent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.sonar.plugins.java.api.tree.Tree
firstToken, is, lastToken, parent
-
-
-
-
Field Detail
-
sema
public JSema sema
-
-
Constructor Detail
-
CompilationUnitTreeImpl
public CompilationUnitTreeImpl(@Nullable PackageDeclarationTree packageDeclaration, List<ImportClauseTree> imports, List<Tree> types, @Nullable ModuleDeclarationTree moduleDeclaration, SyntaxToken eofToken)
-
-
Method Detail
-
imports
public List<ImportClauseTree> imports()
- Specified by:
imports
in interfaceCompilationUnitTree
-
types
public List<Tree> types()
- Specified by:
types
in interfaceCompilationUnitTree
-
accept
public void accept(TreeVisitor visitor)
-
children
public Iterable<Tree> children()
Description copied from class:JavaTree
Creates iterable for children of this node. Note that iterable may containnull
elements.
-
packageDeclaration
@Nullable public PackageDeclarationTree packageDeclaration()
- Specified by:
packageDeclaration
in interfaceCompilationUnitTree
-
moduleDeclaration
@Nullable public ModuleDeclarationTree moduleDeclaration()
Description copied from interface:CompilationUnitTree
Experimental feature allowing retrieval of java 9 module declaration from 'module-info.java' files. In java 9, a new compilation unit level has been introduced, splitting current compilation units between 'Modular' and 'Ordinary' Compilation Units. In order to not introduce breaking change in API too early, and as long as java 9 is not officially released, the 'Module Declaration' part of the Java 9 'Modular Compilation Unit' will be part of the current Compilation Unit interface.- Specified by:
moduleDeclaration
in interfaceCompilationUnitTree
-
eofToken
public SyntaxToken eofToken()
- Specified by:
eofToken
in interfaceCompilationUnitTree
-
-