Class MediaPackageParser


  • public final class MediaPackageParser
    extends Object
    Convenience implementation that supports serializing and deserializing media packages.
    • Method Detail

      • getAsXml

        public static String getAsXml​(MediaPackage mediaPackage)
        Serializes the media package to a string.
        Parameters:
        mediaPackage - the media package
        Returns:
        the serialized media package
      • getAsJSON

        public static String getAsJSON​(MediaPackage mediaPackage)
        Serializes the media package to a JSON string.
        Parameters:
        mediaPackage - the media package
        Returns:
        the serialized media package
      • getAsXmlDocument

        public static Document getAsXmlDocument​(MediaPackage mp)
        Serializes a media package to a Document without any further processing.
      • getFromXml

        public static MediaPackage getFromXml​(String xml)
                                       throws MediaPackageException
        Parses the media package and returns its object representation.
        Parameters:
        xml - the serialized media package
        Returns:
        the media package instance
        Throws:
        MediaPackageException - if de-serializing the media package fails
      • getArrayAsXml

        public static String getArrayAsXml​(List<MediaPackage> mediaPackages)
                                    throws MediaPackageException
        Serializes media package list to a string.
        Parameters:
        mediaPackages - media package list to be serialized
        Returns:
        serialized media package list
        Throws:
        MediaPackageException - if serialization fails