All Known Implementing Classes:
JsonSerializer, XmlSerializer

public interface IDataSerializer
Serializer interface for DataValue serialization.
Since:
9.3
Author:
A.Pragt
  • Method Details

    • getMimeType

      String getMimeType()
      Returns the mime type of the serialized data.
      Returns:
      The mimetype, never null.
    • serialize

      void serialize(DataValue data, Writer target)
      Serializes an object to a writer
      Parameters:
      data - The data to serialize, not null.
      target - The target stream to write to, not null.
      Throws:
      DataSerializationException - when serializing fails
    • deserialize

      DataValue deserialize(DataValueType type, Reader reader)
      Deserializes data (as provided by a reader) to an object of a particular type.
      Parameters:
      type - The type description of the data to be deserialized, not null.
      reader - The source Reader to read from, not null.
      Returns:
      The deserialized object, never null.
      Throws:
      DataSerializationException - when deserializing fails
    • deserializeWithoutChecking

      DataValue deserializeWithoutChecking(DataValueType type, Reader reader)
      Deserializes data (as provided by a reader) to an object of a particular type. If the value provided does not conform to the schema this method will continue and leaves the error detection to the parser.
      Parameters:
      type - The type description of the data to be deserialized, not null.
      reader - The source Reader to read from, not null.
      Returns:
      The deserialized object, never null.
      Throws:
      DataSerializationException - when deserializing fails