List of usage examples for javax.json JsonNumber toString
@Override String toString();
From source file:com.buffalokiwi.aerodrome.jet.Utils.java
public static Money jsonNumberToMoney(final JsonNumber n) { if (n == null) return new Money(); return Money.createFromStringOrZero(n.toString()); }
From source file:org.apache.unomi.services.services.SegmentServiceImpl.java
public static void dumpJSON(JsonValue tree, String key, String depthPrefix) { if (key != null) logger.info(depthPrefix + "Key " + key + ": "); switch (tree.getValueType()) { case OBJECT:/*from ww w. j a v a2 s. c o m*/ logger.info(depthPrefix + "OBJECT"); JsonObject object = (JsonObject) tree; for (String name : object.keySet()) dumpJSON(object.get(name), name, depthPrefix + " "); break; case ARRAY: logger.info(depthPrefix + "ARRAY"); JsonArray array = (JsonArray) tree; for (JsonValue val : array) dumpJSON(val, null, depthPrefix + " "); break; case STRING: JsonString st = (JsonString) tree; logger.info(depthPrefix + "STRING " + st.getString()); break; case NUMBER: JsonNumber num = (JsonNumber) tree; logger.info(depthPrefix + "NUMBER " + num.toString()); break; case TRUE: case FALSE: case NULL: logger.info(depthPrefix + tree.getValueType().toString()); break; } }