@Override public void writeTypePrefixForScalar(Object value, JsonGenerator jgen) throws IOException, JsonProcessingException { // can still wrap ok jgen.writeStartObject(); jgen.writeFieldName(idFromValue(value)); }
@Override public void writeTypePrefixForScalar(Object value, JsonGenerator jgen) throws IOException, JsonProcessingException { // can still wrap ok jgen.writeStartObject(); jgen.writeFieldName(idFromValue(value)); }
@Override public void writeTypePrefixForArray(Object value, JsonGenerator jgen) throws IOException, JsonProcessingException { // can still wrap ok jgen.writeStartObject(); // and then JSON Array start caller wants jgen.writeArrayFieldStart(idFromValue(value)); }
@Override public void writeTypePrefixForArray(Object value, JsonGenerator jgen) throws IOException, JsonProcessingException { // can still wrap ok jgen.writeStartObject(); // and then JSON Array start caller wants jgen.writeArrayFieldStart(idFromValue(value)); }
@Override public void writeTypePrefixForObject(Object value, JsonGenerator jgen) throws IOException, JsonProcessingException { // wrapper jgen.writeStartObject(); // and then JSON Object start caller wants jgen.writeObjectFieldStart(idFromValue(value)); }
@Override public void writeTypePrefixForObject(Object value, JsonGenerator jgen) throws IOException, JsonProcessingException { // wrapper jgen.writeStartObject(); // and then JSON Object start caller wants jgen.writeObjectFieldStart(idFromValue(value)); }
@Override public void writeTypePrefixForScalar(Object value, JsonGenerator g) throws IOException { final String typeId = idFromValue(value); if (g.canWriteTypeId()) { if (typeId != null) { g.writeTypeId(typeId); } } else { // can still wrap ok g.writeStartObject(); g.writeFieldName(_validTypeId(typeId)); } }
@Override public void writeTypePrefixForArray(Object value, JsonGenerator jgen) throws IOException { String typeId = idFromValue(value); if (jgen.canWriteTypeId()) { if (typeId != null) { jgen.writeTypeId(typeId); } jgen.writeStartArray(); } else { // can still wrap ok jgen.writeStartObject(); jgen.writeArrayFieldStart(_validTypeId(typeId)); } }
@Override public void writeTypePrefixForScalar(Object value, JsonGenerator jgen) throws IOException { final String typeId = idFromValue(value); if (jgen.canWriteTypeId()) { if (typeId != null) { jgen.writeTypeId(typeId); } } else { // can still wrap ok jgen.writeStartObject(); jgen.writeFieldName(_validTypeId(typeId)); } }
@Override public void writeTypePrefixForScalar(Object value, JsonGenerator jgen) throws IOException { final String typeId = idFromValue(value); if (jgen.canWriteTypeId()) { if (typeId != null) { jgen.writeTypeId(typeId); } } else { // can still wrap ok jgen.writeStartObject(); jgen.writeFieldName(_validTypeId(typeId)); } }
@Override public void writeTypePrefixForArray(Object value, JsonGenerator jgen) throws IOException { String typeId = idFromValue(value); if (jgen.canWriteTypeId()) { if (typeId != null) { jgen.writeTypeId(typeId); } jgen.writeStartArray(); } else { // can still wrap ok jgen.writeStartObject(); jgen.writeArrayFieldStart(_validTypeId(typeId)); } }
@Override public void writeTypePrefixForArray(Object value, JsonGenerator g) throws IOException { String typeId = idFromValue(value); if (g.canWriteTypeId()) { if (typeId != null) { g.writeTypeId(typeId); } g.writeStartArray(); } else { // can still wrap ok g.writeStartObject(); g.writeArrayFieldStart(_validTypeId(typeId)); } }
@Override public void writeTypePrefixForObject(Object value, JsonGenerator jgen) throws IOException { String typeId = idFromValue(value); if (jgen.canWriteTypeId()) { if (typeId != null) { jgen.writeTypeId(typeId); } jgen.writeStartObject(); } else { // wrapper jgen.writeStartObject(); // and then JSON Object start caller wants // 28-Jan-2015, tatu: No really good answer here; can not really change // structure, so change null to empty String... jgen.writeObjectFieldStart(_validTypeId(typeId)); } }
@Override public void writeTypePrefixForObject(Object value, JsonGenerator jgen) throws IOException { String typeId = idFromValue(value); if (jgen.canWriteTypeId()) { if (typeId != null) { jgen.writeTypeId(typeId); } jgen.writeStartObject(); } else { // wrapper jgen.writeStartObject(); // and then JSON Object start caller wants // 28-Jan-2015, tatu: No really good answer here; can not really change // structure, so change null to empty String... jgen.writeObjectFieldStart(_validTypeId(typeId)); } }
@Override public void writeTypePrefixForObject(Object value, JsonGenerator g) throws IOException { String typeId = idFromValue(value); if (g.canWriteTypeId()) { if (typeId != null) { g.writeTypeId(typeId); } g.writeStartObject(); } else { // wrapper g.writeStartObject(); // and then JSON Object start caller wants // 28-Jan-2015, tatu: No really good answer here; can not really change // structure, so change null to empty String... g.writeObjectFieldStart(_validTypeId(typeId)); } }