if (stateObject.isDecorated()) {
toText(stateObject);
}
else {
OrderByClause expression = stateObject.getExpression();
// 'ORDER BY'
appendIdentifier((expression != null) ? expression.getActualIdentifier() : ORDER_BY, ORDER_BY);
if (shouldOutput(expression) || expression.hasSpaceAfterIdentifier()) {
writer.append(SPACE);
}
// Order by items
if (stateObject.hasItems()) {