static boolean shouldVisitChildren(Object object) { Class type = object.getClass(); if (isPrimitiveOrWrapper(type)) { return false; } if (isSpecialObject(object)) { return false; } return true; }
static boolean visitChildren(Object object) { Class type = object.getClass(); if (isPrimitiveOrWrapper(type)) { return false; } if (isSpecialObject(object)) { return false; } return true; }
List<Object> getChildrens(Writer w, Object object) throws IOException { if (isSpecialObject(object)) { return this.visitSpecialObjects(w, object, false); } else { return this.visitChildrens(w, object, false); } }
} else if (isSpecialObject(item)) { visitSpecialObjects(w, item, true); } else {
void writeArray(Writer w, Object object) throws IOException { if (commanate) { w.write(","); } w.write('['); int length = Array.getLength(object); int elements = 0; for (int i = 0; i < length && elements < COLLECTION_ELEMENT_LIMMIT; i += 1) { Object item = Array.get(object, i); if (i != 0) { w.write(","); } Class clazz = item.getClass(); if (isPrimitiveOrWrapper(clazz)) { writePrimitives(w, item); } else if (isSpecialObject(item)) { writeSpecialObjects(w, item); } else { writeVal(w, item); } elements++; commanate = false; } w.write(']'); commanate = true; return; }
writePrimitives(w, value); commanate = true; } else if (isSpecialObject(value)) { commanate = false; visitSpecialObjects(w, value, true);
void writeKeyValue(Writer w, Object key, Object value, Class type) throws IOException { if (commanate) { w.write(","); } if (value == null || value.equals(null)) { w.write(quote(key.toString())); w.write(':'); w.write("null"); commanate = true; return; } Class clazz = value.getClass(); w.write(quote(key.toString())); w.write(':'); if (type != null) { writeType(w, type); } if (isPrimitiveOrWrapper(clazz)) { commanate = true; writePrimitives(w, value); } else if (isSpecialObject(value)) { commanate = false; writeSpecialObjects(w, value); } else { commanate = false; writeVal(w, value); } endType(w, clazz); return; }
void writeValue(Writer w, Object value) { try { if (value == null || value.equals(null)) { w.write("null"); return; } Class rootClazz = value.getClass(); writeType(w, rootClazz); if (isPrimitiveOrWrapper(rootClazz)) { writePrimitives(w, value); } else if (isSpecialObject(value)) { writeSpecialObjects(w, value); } else { writeVal(w, value); } endType(w, rootClazz); } catch (IOException e) { } }
void writeValue(Writer w, Object value) { try { if (value == null || value.equals(null)) { w.write("null"); return; } this.bfs(w, value); Class rootClazz = value.getClass(); writeType(w, rootClazz, value); if (isPrimitiveOrWrapper(rootClazz)) { writePrimitives(w, value); } else if (isSpecialObject(value)) { visitSpecialObjects(w, value, true); } else { writeVal(w, value); } endType(w, rootClazz); } catch (IOException e) { } }