Package org.davidmoten.oa3.codegen.http
Class DefaultSerializer
java.lang.Object
org.davidmoten.oa3.codegen.http.DefaultSerializer
- All Implemented Interfaces:
Serializer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Tdeserialize(Class<T> cls, String contentType, InputStream in) properties(Object o, String contentType) Returns the properties of object.voidserialize(Object o, String contentType, OutputStream out) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.davidmoten.oa3.codegen.http.Serializer
serialize
-
Constructor Details
-
DefaultSerializer
public DefaultSerializer(com.fasterxml.jackson.databind.ObjectMapper m)
-
-
Method Details
-
serialize
- Specified by:
serializein interfaceSerializer
-
deserialize
- Specified by:
deserializein interfaceSerializer
-
properties
Description copied from interface:SerializerReturns the properties of object. If has no properties or is not an object type that supports properties then returns an empty map. In the case of JSON the map value is of an imprecise type but will serialize to JSON in an expected deterministic way using Jackson serialization (i.e the object could be an annotated Jackson object or an instance ofJsonNode).- Specified by:
propertiesin interfaceSerializer- Parameters:
o- object to get properties from, if null then returns an empty mapcontentType- content type of the object, cannot be null
-