Search in sources :

Example 6 with ModuleNameTree

use of org.sonar.plugins.java.api.tree.ModuleNameTree in project sonar-java by SonarSource.

the class TreeFactory method newExportsModuleDirective.

public ModuleDirectiveTree newExportsModuleDirective(InternalSyntaxToken exportsKeyword, ExpressionTree packageName, Optional<Tuple<InternalSyntaxToken, ListTreeImpl<ModuleNameTree>>> moduleNames, InternalSyntaxToken semicolonToken) {
    InternalSyntaxToken toKeyword = null;
    ListTreeImpl<ModuleNameTree> otherModuleNames = ModuleNameListTreeImpl.emptyList();
    if (moduleNames.isPresent()) {
        Tuple<InternalSyntaxToken, ListTreeImpl<ModuleNameTree>> toModuleNames = moduleNames.get();
        toKeyword = toModuleNames.first();
        otherModuleNames = toModuleNames.second();
    }
    return new ExportsDirectiveTreeImpl(exportsKeyword, packageName, toKeyword, otherModuleNames, semicolonToken);
}
Also used : ExportsDirectiveTreeImpl(org.sonar.java.model.declaration.ExportsDirectiveTreeImpl) ModuleNameListTreeImpl(org.sonar.java.model.declaration.ModuleNameListTreeImpl) TypeArgumentListTreeImpl(org.sonar.java.model.expression.TypeArgumentListTreeImpl) InternalSyntaxToken(org.sonar.java.model.InternalSyntaxToken) ModuleNameTree(org.sonar.plugins.java.api.tree.ModuleNameTree)

Aggregations

ModuleNameTree (org.sonar.plugins.java.api.tree.ModuleNameTree)6 Test (org.junit.Test)4 IdentifierTree (org.sonar.plugins.java.api.tree.IdentifierTree)4 InternalSyntaxToken (org.sonar.java.model.InternalSyntaxToken)2 ModuleNameListTreeImpl (org.sonar.java.model.declaration.ModuleNameListTreeImpl)2 TypeArgumentListTreeImpl (org.sonar.java.model.expression.TypeArgumentListTreeImpl)2 ExpressionTree (org.sonar.plugins.java.api.tree.ExpressionTree)2 MemberSelectExpressionTree (org.sonar.plugins.java.api.tree.MemberSelectExpressionTree)2 ExportsDirectiveTreeImpl (org.sonar.java.model.declaration.ExportsDirectiveTreeImpl)1 OpensDirectiveTreeImpl (org.sonar.java.model.declaration.OpensDirectiveTreeImpl)1 CompilationUnitTree (org.sonar.plugins.java.api.tree.CompilationUnitTree)1 ExportsDirectiveTree (org.sonar.plugins.java.api.tree.ExportsDirectiveTree)1 ModuleDeclarationTree (org.sonar.plugins.java.api.tree.ModuleDeclarationTree)1 OpensDirectiveTree (org.sonar.plugins.java.api.tree.OpensDirectiveTree)1 RequiresDirectiveTree (org.sonar.plugins.java.api.tree.RequiresDirectiveTree)1