java.lang.Object
com.aquima.interactions.communication.data.serialization.xml.XmlSerializer
All Implemented Interfaces:
IDataSerializer

public class XmlSerializer extends Object implements IDataSerializer
Serializer for reading/writing DataObject to Xml format.
Since:
9.3
Author:
A.Pragt
  • Field Details

  • Constructor Details

    • XmlSerializer

      public XmlSerializer()
      Constructs a serializer with no indention.
    • XmlSerializer

      public XmlSerializer(boolean indent)
      Constructs a serializer.
      Parameters:
      indent - Indicator to whether to use indention or not.
  • Method Details

    • getMimeType

      public String getMimeType()
      Description copied from interface: IDataSerializer
      Returns the mime type of the serialized data.
      Specified by:
      getMimeType in interface IDataSerializer
      Returns:
      The mimetype, never null.
    • serialize

      public void serialize(DataValue data, Writer target)
      Description copied from interface: IDataSerializer
      Serializes an object to a writer
      Specified by:
      serialize in interface IDataSerializer
      Parameters:
      data - The data to serialize, not null.
      target - The target stream to write to, not null.
    • deserialize

      public DataValue deserialize(DataValueType type, Reader source)
      Description copied from interface: IDataSerializer
      Deserializes data (as provided by a reader) to an object of a particular type.
      Specified by:
      deserialize in interface IDataSerializer
      Parameters:
      type - The type description of the data to be deserialized, not null.
      source - The source Reader to read from, not null.
      Returns:
      The deserialized object, never null.
    • deserializeWithoutChecking

      public DataValue deserializeWithoutChecking(DataValueType type, Reader reader)
      Description copied from interface: IDataSerializer
      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.
      Specified by:
      deserializeWithoutChecking in interface IDataSerializer
      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.