if (stateObject.isDecorated()) {
toText(stateObject);
}
else {
OrderByItem expression = stateObject.getExpression();
// Order by item
if (stateObject.hasStateObject()) {
stateObject.getStateObject().accept(this);
}
// ASC/DESC
if (!stateObject.isDefault()) {
if (shouldOutput(expression) || expression.hasSpaceAfterExpression()) {
writer.append(SPACE);
}
String ordering = stateObject.getOrdering().name();
String actualOrdering = (expression != null) ? expression.getActualOrdering() : null;
if (!ordering.equalsIgnoreCase(actualOrdering)) {
actualOrdering = ordering;
}