@Override public void writeTree(TreeNode rootNode) throws IOException { // As with 'writeObject()', we are not check if write would work if (rootNode == null) { writeNull(); } else { if (_objectCodec == null) { throw new IllegalStateException("No ObjectCodec defined"); } _objectCodec.writeValue(this, rootNode); } }
@Override public void writeObject(Object value) throws IOException { if (value == null) { // important: call method that does check value write: writeNull(); } else { /* 02-Mar-2009, tatu: we are NOT to call _verifyValueWrite here, * because that will be done when codec actually serializes * contained POJO. If we did call it it would advance state * causing exception later on */ if (_objectCodec != null) { _objectCodec.writeValue(this, value); return; } _writeSimpleObject(value); } }
@Override public void writeObject(Object pojo) throws IOException { if (delegateCopyMethods) { delegate.writeObject(pojo); return; } if (pojo == null) { writeNull(); } else { ObjectCodec c = getCodec(); if (c != null) { c.writeValue(this, pojo); return; } _writeSimpleObject(pojo); } }
@Override public void writeObject(Object value) throws IOException { if (value == null) { writeNull(); return; } Class<?> raw = value.getClass(); if (raw == byte[].class || (value instanceof RawValue)) { _appendValue(JsonToken.VALUE_EMBEDDED_OBJECT, value); return; } if (_objectCodec == null) { /* 28-May-2014, tatu: Tricky choice here; if no codec, should we * err out, or just embed? For now, do latter. */ // throw new JsonMappingException("No ObjectCodec configured for TokenBuffer, writeObject() called"); _appendValue(JsonToken.VALUE_EMBEDDED_OBJECT, value); } else { _objectCodec.writeValue(this, value); } }
@Override public void writeTree(TreeNode rootNode) throws IOException { // As with 'writeObject()', we are not check if write would work if (rootNode == null) { writeNull(); } else { if (_objectCodec == null) { throw new IllegalStateException("No ObjectCodec defined"); } _objectCodec.writeValue(this, rootNode); } }
@Override public void writeTree(TreeNode rootNode) throws IOException { // As with 'writeObject()', we are not check if write would work if (rootNode == null) { writeNull(); } else { if (_objectCodec == null) { throw new IllegalStateException("No ObjectCodec defined"); } _objectCodec.writeValue(this, rootNode); } }
@Override public void writeTree(TreeNode rootNode) throws IOException { // As with 'writeObject()', we are not check if write would work if (rootNode == null) { writeNull(); } else { if (_objectCodec == null) { throw new IllegalStateException("No ObjectCodec defined"); } _objectCodec.writeValue(this, rootNode); } }
@Override public void writeTree(TreeNode rootNode) throws IOException { if (rootNode == null) { writeNull(); } else { if (objectCodec == null) { throw new IllegalStateException("No ObjectCodec defined"); } objectCodec.writeValue(this, rootNode); } }
@Override public void writeTree(TreeNode rootNode) throws IOException { // As with 'writeObject()', we are not check if write would work if (rootNode == null) { writeNull(); } else { if (_objectCodec == null) { throw new IllegalStateException("No ObjectCodec defined"); } _objectCodec.writeValue(this, rootNode); } }
@Override public void writeTree(TreeNode rootNode) throws IOException, JsonProcessingException { // As with 'writeObject()', we are not check if write would work if (rootNode == null) { writeNull(); } else { if (_objectCodec == null) { throw new IllegalStateException("No ObjectCodec defined for the generator, can not serialize JsonNode-based trees"); } _objectCodec.writeValue(this, rootNode); } }
@Override public void writeTree(TreeNode rootNode) throws IOException, JsonProcessingException { // As with 'writeObject()', we are not check if write would work if (rootNode == null) { writeNull(); } else { if (_objectCodec == null) { throw new IllegalStateException("No ObjectCodec defined for the generator, can not serialize JsonNode-based trees"); } _objectCodec.writeValue(this, rootNode); } }
@Override public void serialize( Key value, JsonGenerator jgen, SerializerProvider provider ) throws IOException { if ( value != null || Include.NON_NULL != provider.getConfig().getDefaultPropertyInclusion().getValueInclusion() ) { StringWriter writer = new StringWriter(); JsonGenerator jsonGenerator = jgen.getCodec().getFactory().createGenerator( writer ); jgen.getCodec().writeValue( jsonGenerator, value ); jsonGenerator.close(); jgen.writeFieldName( writer.toString() ); } } }
@Override public void writeObject(Object pojo) throws IOException { if (delegateCopyMethods) { delegate.writeObject(pojo); return; } if (pojo == null) { writeNull(); } else { ObjectCodec c = getCodec(); if (c != null) { c.writeValue(this, pojo); return; } _writeSimpleObject(pojo); } }
@Override public void serialize(God value, JsonGenerator gen, SerializerProvider provider) throws IOException { gen.getCodec().writeValue(gen, value.id); } }
@Override public void serialize(Battle value, JsonGenerator gen, SerializerProvider provider) throws IOException { gen.getCodec().writeValue(gen, value.id); } }
@Override public void serialize(Monster value, JsonGenerator gen, SerializerProvider provider) throws IOException { gen.getCodec().writeValue(gen, value.id); } }
@Override public void writeTree(TreeNode rootNode) throws IOException { if (delegateCopyMethods) { delegate.writeTree(rootNode); return; } // As with 'writeObject()', we are not check if write would work if (rootNode == null) { writeNull(); } else { if (getCodec() == null) { throw new IllegalStateException("No ObjectCodec defined"); } getCodec().writeValue(this, rootNode); } }
@Override public void writeObject(Object pojo) throws IOException,JsonProcessingException { if (delegateCopyMethods) { delegate.writeObject(pojo); return; } // NOTE: copied from if (pojo == null) { writeNull(); } else { if (getCodec() != null) { getCodec().writeValue(this, pojo); return; } _writeSimpleObject(pojo); } }
@Override public void writeObject(Object pojo) throws IOException,JsonProcessingException { if (delegateCopyMethods) { delegate.writeObject(pojo); return; } // NOTE: copied from if (pojo == null) { writeNull(); } else { if (getCodec() != null) { getCodec().writeValue(this, pojo); return; } _writeSimpleObject(pojo); } }
@Override public void writeObject(Object pojo) throws IOException,JsonProcessingException { if (delegateCopyMethods) { delegate.writeObject(pojo); return; } // NOTE: copied from if (pojo == null) { writeNull(); } else { if (getCodec() != null) { getCodec().writeValue(this, pojo); return; } _writeSimpleObject(pojo); } }