if (stateObject.isDecorated()) {
toText(stateObject);
}
else {
SelectClause expression = stateObject.getExpression();
// SELECT
appendIdentifier((expression != null) ? expression.getActualIdentifier() : SELECT, SELECT);
if (shouldOutput(expression) || expression.hasSpaceAfterSelect()) {
writer.append(SPACE);
}
// DISTINCT
if (stateObject.hasDistinct()) {
appendIdentifier((expression != null) ? expression.getActualDistinctIdentifier() : DISTINCT, DISTINCT);
if (shouldOutput(expression) || expression.hasSpaceAfterDistinct()) {
writer.append(SPACE);
}
}
// Select expressions