Search in sources :

Example 1 with ParameterizedTypeTreeImpl

use of org.sonar.java.model.JavaTree.ParameterizedTypeTreeImpl in project sonar-java by SonarSource.

the class TreeFactory method newAnnotatedParameterizedIdentifier.

public ExpressionTree newAnnotatedParameterizedIdentifier(Optional<List<AnnotationTreeImpl>> annotations, InternalSyntaxToken identifierToken, Optional<TypeArgumentListTreeImpl> typeArguments) {
    List<AnnotationTree> annotationList = ImmutableList.copyOf(annotations.or(ImmutableList.of()));
    ExpressionTree result = new IdentifierTreeImpl(identifierToken);
    if (typeArguments.isPresent()) {
        result = new ParameterizedTypeTreeImpl((TypeTree) result, typeArguments.get()).complete(annotationList);
    } else {
        result = ((IdentifierTreeImpl) result).complete(annotationList);
    }
    return result;
}
Also used : IdentifierTreeImpl(org.sonar.java.model.expression.IdentifierTreeImpl) ExpressionTree(org.sonar.plugins.java.api.tree.ExpressionTree) AnnotationTree(org.sonar.plugins.java.api.tree.AnnotationTree) ParameterizedTypeTreeImpl(org.sonar.java.model.JavaTree.ParameterizedTypeTreeImpl)

Aggregations

ParameterizedTypeTreeImpl (org.sonar.java.model.JavaTree.ParameterizedTypeTreeImpl)1 IdentifierTreeImpl (org.sonar.java.model.expression.IdentifierTreeImpl)1 AnnotationTree (org.sonar.plugins.java.api.tree.AnnotationTree)1 ExpressionTree (org.sonar.plugins.java.api.tree.ExpressionTree)1