/** * Factory method for constructing a wrapper for POJO * ("Plain Old Java Object") objects; these will get serialized * using data binding, usually as JSON Objects, but in some * cases as JSON Strings or other node types. */ public POJONode POJONode(Object pojo) { return new POJONode(pojo); } }
/** * Factory method for constructing a wrapper for POJO * ("Plain Old Java Object") objects; these will get serialized * using data binding, usually as JSON Objects, but in some * cases as JSON Strings or other node types. */ public POJONode POJONode(Object pojo) { return new POJONode(pojo); } }
/** * Factory method for constructing a wrapper for POJO * ("Plain Old Java Object") objects; these will get serialized * using data binding, usually as JSON Objects, but in some * cases as JSON Strings or other node types. */ public POJONode POJONode(Object pojo) { return new POJONode(pojo); } }
/** * Factory method for constructing a wrapper for POJO * ("Plain Old Java Object") objects; these will get serialized * using data binding, usually as JSON Objects, but in some * cases as JSON Strings or other node types. */ public POJONode POJONode(Object pojo) { return new POJONode(pojo); } }
/** * Factory method for constructing a wrapper for POJO * ("Plain Old Java Object") objects; these will get serialized * using data binding, usually as JSON Objects, but in some * cases as JSON Strings or other node types. */ public POJONode POJONode(Object pojo) { return new POJONode(pojo); } }
public JsonRepresentation arrayAdd(final Object value) { if (!isArray()) { throw new IllegalStateException("does not represent array"); } asArrayNode().add(new POJONode(value)); return this; }
public void arrayAdd(final Object value) { if (!isArray()) { throw new IllegalStateException("does not represent array"); } asArrayNode().add(new POJONode(value)); }
@SuppressWarnings("unchecked") public static ValueNode toValueNode(final Object value){ if(value == null) return getFactory().nullNode(); final ValueNodeConverter converter = converters.get(value.getClass()); return converter == null ? new POJONode(value) : converter.apply(getFactory(), value); } }
public void mapPut(final String key, final Object value) { if (!isMap()) { throw new IllegalStateException("does not represent map"); } if (value == null) { return; } final Path path = Path.parse(key); final ObjectNode node = JsonNodeUtils.walkNodeUpTo(asObjectNode(), path.getHead()); node.put(path.getTail(), new POJONode(value)); }
public JsonRepresentation mapPut(final String key, final Object value) { if (!isMap()) { throw new IllegalStateException("does not represent map"); } final Path path = Path.parse(key); final ObjectNode node = JsonNodeUtils.walkNodeUpTo(asObjectNode(), path.getHead()); node.put(path.getTail(), value != null ? new POJONode(value) : NullNode.getInstance()); return this; }