Search in sources :

Example 1 with ExportsDirectiveTreeImpl

use of org.sonar.java.model.declaration.ExportsDirectiveTreeImpl 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

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