}
}
private JsonValue getValueForLiteral(String literal) throws JsonException {
if ("".equals(literal)) {
throw new JsonException("Missing value");
}
if ("null".equals(literal) || "undefined".equals(literal)) {
return jsonFactory.createNull();
}
if ("true".equals(literal)) {
return jsonFactory.create(true);
}
if ("false".equals(literal)) {
return jsonFactory.create(false);
}
final char c = literal.charAt(0);
if (c == '-' || Character.isDigit(c)) {
return getNumberForLiteral(literal);
}
throw new JsonException("Invalid literal: \"" + literal + "\"");
}