I have no problem with individual coding preference, but is there a reason not to just use:
} else if (object.isLiteral()) {
?