Interface Serializer

All Known Implementing Classes:
DefaultSerializer

public interface Serializer
  • Method Details

    • serialize

      void serialize(Object o, String contentType, OutputStream out)
    • deserialize

      <T> T deserialize(Class<T> cls, String contentType, InputStream in)
    • properties

      Map<String,Object> properties(Object o, String contentType)
      Returns 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 of JsonNode).
      Parameters:
      o - object to get properties from, if null then returns an empty map
      contentType - content type of the object, cannot be null
    • serialize

      default byte[] serialize(Object o, String contentType)