/** @param knownType May be null if the type is unknown. */ public void writeObjectStart (String name, Class actualType, Class knownType) { try { writer.name(name); } catch (IOException ex) { throw new SerializationException(ex); } writeObjectStart(actualType, knownType); }
public void writeObjectStart (String name) { try { writer.name(name); } catch (IOException ex) { throw new SerializationException(ex); } writeObjectStart(); }
/** @param knownType May be null if the type is unknown. */ public void writeObjectStart (String name, Class actualType, Class knownType) { try { writer.name(name); } catch (IOException ex) { throw new SerializationException(ex); } writeObjectStart(actualType, knownType); }
public void writeObjectStart (String name) { try { writer.name(name); } catch (IOException ex) { throw new SerializationException(ex); } writeObjectStart(); }
|| actualType == Float.class || actualType == Long.class || actualType == Double.class || actualType == Short.class || actualType == Byte.class || actualType == Character.class) { writeObjectStart(actualType, null); writeValue("value", value); writeObjectEnd(); writeObjectStart(actualType, knownType); ((Serializable)value).write(this); writeObjectEnd(); writeObjectStart(actualType, knownType); writeArrayStart("items"); for (Object item : (Collection)value) writeObjectStart(actualType, knownType); for (Entry entry : ((ObjectMap<?, ?>)value).entries()) { writer.name(convertToString(entry.key)); writeObjectStart(actualType, knownType); ArrayMap map = (ArrayMap)value; for (int i = 0, n = map.size; i < n; i++) { writeObjectStart(actualType, knownType); for (Map.Entry entry : ((Map<?, ?>)value).entrySet()) { writer.name(convertToString(entry.getKey())); writeObjectStart(actualType, null); writer.name("value"); writer.value(convertToString((Enum)value));
|| actualType == Float.class || actualType == Long.class || actualType == Double.class || actualType == Short.class || actualType == Byte.class || actualType == Character.class) { writeObjectStart(actualType, null); writeValue("value", value); writeObjectEnd(); writeObjectStart(actualType, knownType); ((Serializable)value).write(this); writeObjectEnd(); writeObjectStart(actualType, knownType); writeArrayStart("items"); for (Object item : (Collection)value) writeObjectStart(actualType, knownType); for (Entry entry : ((ObjectMap<?, ?>)value).entries()) { writer.name(convertToString(entry.key)); writeObjectStart(actualType, knownType); ArrayMap map = (ArrayMap)value; for (int i = 0, n = map.size; i < n; i++) { writeObjectStart(actualType, knownType); for (Map.Entry entry : ((Map<?, ?>)value).entrySet()) { writer.name(convertToString(entry.getKey())); writeObjectStart(actualType, null); writer.name("value"); writer.value(convertToString((Enum)value));
@Override public void write(Json json, SaveFileFormat.ComponentIdentifiers ci, Class knownType) { json.writeObjectStart(); for (Map.Entry<Class<? extends Component>, String> entry : ci.typeToName.entrySet()) { json.writeValue(entry.getKey().getName(), entry.getValue()); } json.writeObjectEnd(); }
@Override public void write(Json json, ArchetypeMapper object, Class knownType) { json.writeObjectStart(); for (Map.Entry<Integer, ArchetypeMapper.TransmuterEntry> entry : object.entrySet()) { json.writeValue(entry.getKey().toString(), entry.getValue()); } json.writeObjectEnd(); }
/** @param knownType May be null if the type is unknown. */ public void writeObjectStart (String name, Class actualType, Class knownType) { try { writer.name(name); } catch (IOException ex) { throw new SerializationException(ex); } writeObjectStart(actualType, knownType); }
public void writeObjectStart (String name) { try { writer.name(name); } catch (IOException ex) { throw new SerializationException(ex); } writeObjectStart(); }
@Override public void write(Json json) { json.writeObjectStart(""); json.writeFields(this); json.writeObjectEnd(); }
private <T> void writeSerializedMap(Field field, SerializedMap map, Json json) throws SerializationException { if (field != null) { json.writeObjectStart(field.getName()); } else { json.writeObjectStart(); } for (Object key : map.keys()) { writeObject(field, map.get(key), key.toString(), json); } json.writeObjectEnd(); }
@Override public void write(Json json, Arrangement object, Class knownType) { if(object == null) { json.writeValue(null); return; } json.writeObjectStart(); json.writeValue("k", object.keysAsOrderedSet(), OrderedSet.class); json.writeValue("f", object.f); json.writeObjectEnd(); }
@Override public String serializeState() { StringWriter buffer = new StringWriter(); try { Json json = new Json(); json.setWriter(new JsonWriter(buffer)); json.writeObjectStart(); json.writeValue("encoding", encoding.name()); json.writeValue("quality", quality); json.writeObjectEnd(); return buffer.toString(); } finally { StreamUtils.closeQuietly(buffer); } }
@Override public void write(Json json, K2 object, Class knownType) { if(object == null) { json.writeValue(null); return; } json.writeObjectStart(); json.writeValue("a", object.getSetA(), SortedSet.class); json.writeValue("b", object.getSetB(), SortedSet.class); json.writeObjectEnd(); }
@Override public void write(Json json) { SceneActorRef actorRef; json.writeObjectStart("actors"); for (InteractiveActor a : actors) { actorRef = new SceneActorRef(a.getInitScene(), a.getId()); json.writeValue(actorRef.toString(), a); } json.writeObjectEnd(); }
@Override public void write(Json json) { SceneActorRef actorRef; json.writeValue("visible", visible); json.writeObjectStart("items"); for (SpriteActor a : items) { actorRef = new SceneActorRef(a.getInitScene(), a.getId()); json.writeValue(actorRef.toString(), a); } json.writeObjectEnd(); }
@Override public void write(Json json, StringStringMap object, Class knownType) { if(object == null) { json.writeValue(null); return; } json.writeObjectStart(); json.writeValue("k", object.keysAsOrderedSet(), OrderedSet.class, String.class); json.writeValue("v", object.valuesAsList(), ArrayList.class, String.class); json.writeValue("f", object.f); json.writeObjectEnd(); }
@Override public void write(Json json, ScaleFactorModel model, Class knownType) { json.writeObjectStart(); json.writeValue("suffix", model.getSuffix()); json.writeValue("factor", model.getFactor()); json.writeValue("resampling", model.getResampling().name()); json.writeObjectEnd(); }
@Override public void write(Json json, K2V1 object, Class knownType) { if(object == null) { json.writeValue(null); return; } json.writeObjectStart(); json.writeValue("a", object.getSetA(), SortedSet.class); json.writeValue("b", object.getSetB(), SortedSet.class); json.writeValue("q", object.getListQ(), ArrayList.class); json.writeObjectEnd(); }