use of org.sonar.java.model.JavaTree.ImportTreeImpl in project sonar-java by SonarSource.
the class TreeFactory method newImportDeclaration.
public ImportTreeImpl newImportDeclaration(InternalSyntaxToken importToken, Optional<InternalSyntaxToken> staticToken, ExpressionTree qualifiedIdentifier, Optional<Tuple<InternalSyntaxToken, InternalSyntaxToken>> dotStar, InternalSyntaxToken semicolonToken) {
ExpressionTree target = qualifiedIdentifier;
if (dotStar.isPresent()) {
IdentifierTreeImpl identifier = new IdentifierTreeImpl(dotStar.get().second());
InternalSyntaxToken dotToken = dotStar.get().first();
target = new MemberSelectExpressionTreeImpl(qualifiedIdentifier, dotToken, identifier);
}
InternalSyntaxToken staticKeyword = staticToken.orNull();
return new ImportTreeImpl(importToken, staticKeyword, target, semicolonToken);
}
Aggregations