Class AbstractFieldJsonSerializer
java.lang.Object
com.emc.documentum.rest.parser.json.writer.field.AbstractFieldJsonSerializer
- All Implemented Interfaces:
AnnotatedFieldBindingProcessor,AnnotatedFieldSerializer<com.emc.documentum.rest.parser.json.writer.TypeJsonWriter>
- Direct Known Subclasses:
DelayedFieldJsonSerializer,EntryFieldJsonSerializer,ListFieldJsonSerializer,MapFieldJsonSerializer,NullFieldJsonSerializer,ObjectFieldJsonSerializer,SimpleDataFieldJsonSerializer
public abstract class AbstractFieldJsonSerializer
extends Object
implements AnnotatedFieldSerializer<com.emc.documentum.rest.parser.json.writer.TypeJsonWriter>
This abstract class has default implementation for JSON field serializer.
Also it contains JSON specified writer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisCompatibleMediaType(org.springframework.http.MediaType mediaType) Check if the message serializer or deserializer is compatible with the specified media type.voidserializeKeyValue(com.emc.documentum.rest.parser.json.writer.TypeJsonWriter writer, String key, Object value, org.springframework.http.MediaType contentType, com.emc.documentum.rest.config.BindingConfig bindingConfig) Serializes the object in a map as the entry value.voidserializeValue(com.emc.documentum.rest.parser.json.writer.TypeJsonWriter writer, Object value) Serializes the object in a map as the entry value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.emc.documentum.rest.wire.AnnotatedFieldSerializer
serializable, serialize
-
Constructor Details
-
AbstractFieldJsonSerializer
public AbstractFieldJsonSerializer()
-
-
Method Details
-
serializeKeyValue
public void serializeKeyValue(com.emc.documentum.rest.parser.json.writer.TypeJsonWriter writer, String key, Object value, org.springframework.http.MediaType contentType, com.emc.documentum.rest.config.BindingConfig bindingConfig) Serializes the object in a map as the entry value. This method must be implemented if the target object supports to be serialized in a map.- Parameters:
writer- message writerkey- the serializable name of the field to serializevalue- the object value to serializecontentType- content type of target representationbindingConfig- the binding configuration
-
serializeValue
public void serializeValue(com.emc.documentum.rest.parser.json.writer.TypeJsonWriter writer, Object value) Serializes the object in a map as the entry value. This method must be implemented if the target object supports to be serialized in a list.- Parameters:
writer- message writervalue- the object value to serialize
-
isCompatibleMediaType
public boolean isCompatibleMediaType(org.springframework.http.MediaType mediaType) Description copied from interface:AnnotatedFieldBindingProcessorCheck if the message serializer or deserializer is compatible with the specified media type.- Specified by:
isCompatibleMediaTypein interfaceAnnotatedFieldBindingProcessor- Parameters:
mediaType- the media type to check- Returns:
truefor compatible
-