Interface XMPSerializer

All Known Implementing Classes:
RDFXMLSerializer

public interface XMPSerializer
Interface for all kinds of serializers for the XMP data model.
  • Method Details

    • serialize

      void serialize(XMPMetadata xmp, OutputStream out, Map<String,Object> serializeContext) throws IOException, XMPException
      Serialize XMP data as RDF/XML to an OutputStream
      Parameters:
      xmp - the XMP object to serialize
      out - the stream to write to. Client has to open/close the stream.
      serializeContext - an optional serialization context that can contains additional information to configure the serialization.
      Throws:
      IOException - If an error occurred writing to the stream
      XMPException - This exception is thrown if the data model contains portions that can't be serialized by a specific serializer or if the options are inconsistent.
    • serializeToString

      String serializeToString(XMPMetadata xmp, Map<String,Object> serializeContext) throws IOException, XMPException
      Serialize XMP data as RDF/XML into a String
      Parameters:
      xmp - the XMP object to serialize
      serializeContext - an optional serialization context that can contains additional information to configure the serialization.
      Returns:
      String containing the XMP data as RDF/XML
      Throws:
      IOException - If an error occurred writing to the internal stream or out of memory
      XMPException - This exception is thrown if the data model contains portions that can't be serialized by a specific serializer or if the options are inconsistent.
    • serializeToBuffer

      byte[] serializeToBuffer(XMPMetadata xmp, Map<String,Object> serializeContext) throws IOException, XMPException
      Serialize XMP data as RDF/XML UTF-8 encoded into a byte buffer
      Parameters:
      xmp - the XMP object to serialize
      serializeContext - an optional serialization context that can contains additional information to configure the serialization.
      Returns:
      Buffer containing the XMP data as RDF/XML
      Throws:
      IOException - If an error occurred writing to the stream
      XMPException - This exception is thrown if the data model contains portions that can't be serialized by a specific serializer or if the options are inconsistent.