XMPHandler (JHOVE Documentation)
Date: 2013-09-08

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.harvard.hul.ois.jhove
Class XMPHandler

    java.lang.Object
      org.xml.sax.helpers.DefaultHandler
          edu.harvard.hul.ois.jhove.XMPHandler

All Implemented Interfaces:
  org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

    public class XMPHandler

extends org.xml.sax.helpers.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.

Constructor Summary
`XMPHandler()`

Method Summary
`void` | `endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String rawName)` Catches the end of an element.
`void` | `fatalError(org.xml.sax.SAXParseException exception)` Catch a fatal error.
`boolean` | `isPdfaCompliant()` Returns true if no violations of PDF/A compliance have been found, false if a problem was detected.
`void` | `processingInstruction(java.lang.String target, java.lang.String data)`
`void` | `startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String rawName, org.xml.sax.Attributes atts)` Catches the start of an element and, if it's one we care about, sets state information.

Methods inherited from class org.xml.sax.helpers.DefaultHandler
`characters, endDocument, endPrefixMapping, error, ignorableWhitespace, notationDecl, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### XMPHandler

    public XMPHandler()

Method Detail

### isPdfaCompliant

    public boolean isPdfaCompliant()

  Returns true if no violations of PDF/A compliance have been found, false if a problem was detected.

### processingInstruction

    public void processingInstruction(java.lang.String target,
                                      java.lang.String data)
                               throws org.xml.sax.SAXException

  Specified by:
    `processingInstruction` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `processingInstruction` in class `org.xml.sax.helpers.DefaultHandler`
  Throws:
    `org.xml.sax.SAXException`

### startElement

    public void startElement(java.lang.String namespaceURI,
                             java.lang.String localName,
                             java.lang.String rawName,
                             org.xml.sax.Attributes atts)
                      throws org.xml.sax.SAXException

  Catches the start of an element and, if it's one we care about, sets state information.

  Specified by:
    `startElement` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `startElement` in class `org.xml.sax.helpers.DefaultHandler`
  Throws:
    `org.xml.sax.SAXException`

### endElement

    public void endElement(java.lang.String namespaceURI,
                           java.lang.String localName,
                           java.lang.String rawName)
                    throws org.xml.sax.SAXException

  Catches the end of an element.

  Specified by:
    `endElement` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `endElement` in class `org.xml.sax.helpers.DefaultHandler`
  Throws:
    `org.xml.sax.SAXException`

### fatalError

    public void fatalError(org.xml.sax.SAXParseException exception)
                    throws org.xml.sax.SAXException

  Catch a fatal error. This is put here because the default behavior is to report a "fatal error" to standard output, which is harmless but scary.

  Specified by:
    `fatalError` in interface `org.xml.sax.ErrorHandler`
  Overrides:
    `fatalError` in class `org.xml.sax.helpers.DefaultHandler`
  Throws:
    `org.xml.sax.SAXException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD