Class XMPHandler

  • All Implemented Interfaces:
    ContentHandler, DTDHandler, EntityResolver, ErrorHandler

    public class XMPHandler
    extends DefaultHandler
    This class encapsulates XMP metadata within a file. It makes use of an InputStream as a data source. This differs from normal XML handling in that it's necessary to process the xpacket processing instruction in order to determine the encoding of the XML. the processingInstruction function looks for xpacket, and throws a special SAXException if it's necessary to change encoding. We don't actually extract any information from the XMP, but simply check it for well-formedness. By convention, XMPHandler should be invoked on an XMPSource (TBW), which provides the ability to recapture the InputStream from which the XMP was obtained and put it into a property once it's verified here.