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
-
-
Field Summary
Fields Modifier and Type Field Description JSemasema-
Fields inherited from class org.sonar.java.model.JavaTree
grammarRuleKey, root
-
-
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 voidaccept(TreeVisitor visitor)Iterable<Tree>children()Creates iterable for children of this node.SyntaxTokeneofToken()List<ImportClauseTree>imports()Tree.Kindkind()ModuleDeclarationTreemoduleDeclaration()Experimental feature allowing retrieval of java 9 module declaration from 'module-info.java' files.PackageDeclarationTreepackageDeclaration()List<Tree>types()-
Methods inherited from class org.sonar.java.model.JavaTree
firstToken, getChildren, getGrammarRuleKey, 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:
importsin interfaceCompilationUnitTree
-
types
public List<Tree> types()
- Specified by:
typesin interfaceCompilationUnitTree
-
accept
public void accept(TreeVisitor visitor)
-
children
public Iterable<Tree> children()
Description copied from class:JavaTreeCreates iterable for children of this node. Note that iterable may containnullelements.
-
packageDeclaration
@Nullable public PackageDeclarationTree packageDeclaration()
- Specified by:
packageDeclarationin interfaceCompilationUnitTree
-
moduleDeclaration
@Nullable public ModuleDeclarationTree moduleDeclaration()
Description copied from interface:CompilationUnitTreeExperimental 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:
moduleDeclarationin interfaceCompilationUnitTree
-
eofToken
public SyntaxToken eofToken()
- Specified by:
eofTokenin interfaceCompilationUnitTree
-
-