Search in sources :

Example 26 with InternalSyntaxToken

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

the class TreeFactory method newArrayTypeTree.

@CheckForNull
private static ArrayTypeTreeImpl newArrayTypeTree(Optional<List<Tuple<InternalSyntaxToken, InternalSyntaxToken>>> dims) {
    ArrayTypeTreeImpl result = null;
    if (dims.isPresent()) {
        for (Tuple<InternalSyntaxToken, InternalSyntaxToken> dim : dims.get()) {
            InternalSyntaxToken openBracketToken = dim.first();
            InternalSyntaxToken closeBracketToken = dim.second();
            result = new ArrayTypeTreeImpl(result, ImmutableList.<AnnotationTreeImpl>of(), openBracketToken, closeBracketToken);
        }
    }
    return result;
}
Also used : AnnotationTreeImpl(org.sonar.java.model.declaration.AnnotationTreeImpl) ArrayTypeTreeImpl(org.sonar.java.model.JavaTree.ArrayTypeTreeImpl) InternalSyntaxToken(org.sonar.java.model.InternalSyntaxToken) CheckForNull(javax.annotation.CheckForNull)

Aggregations

InternalSyntaxToken (org.sonar.java.model.InternalSyntaxToken)26 IdentifierTreeImpl (org.sonar.java.model.expression.IdentifierTreeImpl)9 ExpressionTree (org.sonar.plugins.java.api.tree.ExpressionTree)8 ImmutableList (com.google.common.collect.ImmutableList)7 Optional (com.sonar.sslr.api.typed.Optional)5 AnnotationTreeImpl (org.sonar.java.model.declaration.AnnotationTreeImpl)4 ArrayList (java.util.ArrayList)3 ArrayTypeTreeImpl (org.sonar.java.model.JavaTree.ArrayTypeTreeImpl)3 MemberSelectExpressionTreeImpl (org.sonar.java.model.expression.MemberSelectExpressionTreeImpl)3 TypeArgumentListTreeImpl (org.sonar.java.model.expression.TypeArgumentListTreeImpl)3 ArrayDimensionTree (org.sonar.plugins.java.api.tree.ArrayDimensionTree)3 SyntaxToken (org.sonar.plugins.java.api.tree.SyntaxToken)3 ArrayDimensionTreeImpl (org.sonar.java.model.ArrayDimensionTreeImpl)2 JavaTree (org.sonar.java.model.JavaTree)2 MethodTreeImpl (org.sonar.java.model.declaration.MethodTreeImpl)2 ModuleNameListTreeImpl (org.sonar.java.model.declaration.ModuleNameListTreeImpl)2 VariableTreeImpl (org.sonar.java.model.declaration.VariableTreeImpl)2 ArrayAccessExpressionTreeImpl (org.sonar.java.model.expression.ArrayAccessExpressionTreeImpl)2 NewArrayTreeImpl (org.sonar.java.model.expression.NewArrayTreeImpl)2 NewClassTreeImpl (org.sonar.java.model.expression.NewClassTreeImpl)2