@Override
    public String visit(FactoryExpression<?> e, Templates templates) {
        final StringBuilder builder = new StringBuilder();
        builder.append("new ").append(e.getType().getSimpleName()).append("(");
        boolean first = true;
        for (Expression<?> arg : e.getArgs()) {
            if (!first) {
                builder.append(", ");
            }
            builder.append(arg.accept(this, templates));
            first = false;
        }
        builder.append(")");
        return builder.toString();
    }
{@code ToStringVisitor} is used for toString() serialization in {@link Expression} implementations.

@author tiwe
querydsl-core/src/main/java/com/querydsl/core/types/ToStringVisitor.java