Search in sources :

Example 1 with ConstructorExpression

use of org.eclipse.persistence.jpa.jpql.parser.ConstructorExpression in project eclipselink by eclipse-ee4j.

the class AbstractActualJPQLQueryFormatter method visit.

@Override
public void visit(ConstructorExpressionStateObject stateObject) {
    if (stateObject.isDecorated()) {
        toText(stateObject);
    } else {
        ConstructorExpression expression = stateObject.getExpression();
        // 'NEW'
        appendIdentifier((expression != null) ? expression.getActualIdentifier() : NEW, NEW);
        if (shouldOutput(expression) || expression.hasSpaceAfterNew()) {
            writer.append(SPACE);
        }
        // Class name
        writer.append(stateObject.getClassName());
        // '('
        if (shouldOutput(expression) || expression.hasLeftParenthesis()) {
            writer.append(LEFT_PARENTHESIS);
        }
        toStringChildren(stateObject, true);
        // ')'
        if (shouldOutput(expression) || expression.hasRightParenthesis()) {
            writer.append(RIGHT_PARENTHESIS);
        }
    }
}
Also used : ConstructorExpression(org.eclipse.persistence.jpa.jpql.parser.ConstructorExpression)

Aggregations

ConstructorExpression (org.eclipse.persistence.jpa.jpql.parser.ConstructorExpression)1