Search in sources :

Example 1 with OpensDirectiveTreeImpl

use of org.sonar.java.model.declaration.OpensDirectiveTreeImpl in project sonar-java by SonarSource.

the class TreeFactory method newOpensModuleDirective.

public ModuleDirectiveTree newOpensModuleDirective(InternalSyntaxToken opensKeyword, 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 OpensDirectiveTreeImpl(opensKeyword, packageName, toKeyword, otherModuleNames, semicolonToken);
}
Also used : ModuleNameListTreeImpl(org.sonar.java.model.declaration.ModuleNameListTreeImpl) TypeArgumentListTreeImpl(org.sonar.java.model.expression.TypeArgumentListTreeImpl) OpensDirectiveTreeImpl(org.sonar.java.model.declaration.OpensDirectiveTreeImpl) InternalSyntaxToken(org.sonar.java.model.InternalSyntaxToken) ModuleNameTree(org.sonar.plugins.java.api.tree.ModuleNameTree)

Aggregations

InternalSyntaxToken (org.sonar.java.model.InternalSyntaxToken)1 ModuleNameListTreeImpl (org.sonar.java.model.declaration.ModuleNameListTreeImpl)1 OpensDirectiveTreeImpl (org.sonar.java.model.declaration.OpensDirectiveTreeImpl)1 TypeArgumentListTreeImpl (org.sonar.java.model.expression.TypeArgumentListTreeImpl)1 ModuleNameTree (org.sonar.plugins.java.api.tree.ModuleNameTree)1