@Override
    public String visit(TemplateExpression<?> expr, Templates templates) {
        final StringBuilder builder = new StringBuilder();
        for (Template.Element element : expr.getTemplate().getElements()) {
            Object rv = element.convert(expr.getArgs());
            if (rv instanceof Expression) {
                builder.append(((Expression<?>) rv).accept(this, templates));
            } else {
                builder.append(rv.toString());
            }
        }
        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