Search in sources :

Example 1 with TypeCastExpressionTreeImpl

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

the class TreeFactory method newClassCastExpression.

public TypeCastExpressionTreeImpl newClassCastExpression(TypeTree type, Optional<Tuple<InternalSyntaxToken, BoundListTreeImpl>> classTypes, InternalSyntaxToken closeParenToken, ExpressionTree expression) {
    BoundListTreeImpl bounds = BoundListTreeImpl.emptyList();
    InternalSyntaxToken andToken = null;
    if (classTypes.isPresent()) {
        andToken = classTypes.get().first();
        bounds = classTypes.get().second();
    }
    return new TypeCastExpressionTreeImpl(type, andToken, bounds, closeParenToken, expression);
}
Also used : InternalSyntaxToken(org.sonar.java.model.InternalSyntaxToken) TypeCastExpressionTreeImpl(org.sonar.java.model.expression.TypeCastExpressionTreeImpl)

Aggregations

InternalSyntaxToken (org.sonar.java.model.InternalSyntaxToken)1 TypeCastExpressionTreeImpl (org.sonar.java.model.expression.TypeCastExpressionTreeImpl)1