Exemplo n.º 1
0
 /**
  * Main serialization method that will delegate actual output to configured {@link
  * BeanPropertyWriter} instances.
  */
 @Override
 public final void serialize(Object bean, JsonGenerator jgen, SerializerProvider provider)
     throws IOException, JsonGenerationException {
   if (_objectIdWriter != null) {
     _serializeWithObjectId(bean, jgen, provider, true);
     return;
   }
   jgen.writeStartObject();
   if (_propertyFilterId != null) {
     serializeFieldsFiltered(bean, jgen, provider);
   } else {
     serializeFields(bean, jgen, provider);
   }
   jgen.writeEndObject();
 }
Exemplo n.º 2
0
 public void writeAsField(JsonGenerator jgen, SerializerProvider provider, ObjectIdWriter w)
     throws IOException, JsonGenerationException {
   SerializedString name = w.propertyName;
   idWritten = true;
   if (name != null) {
     jgen.writeFieldName(name);
     w.serializer.serialize(id, jgen, provider);
   }
 }
Exemplo n.º 3
0
 @Override
 public void serialize(T value, JsonGenerator jgen, SerializerProvider provider)
     throws IOException, JsonGenerationException {
   jgen.writeRawValue(value.toString());
 }