Class FileOME.MyXMLHandler

java.lang.Object
org.xml.sax.helpers.DefaultHandler
gov.nih.mipav.model.file.FileOME.MyXMLHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler
Enclosing class:
FileOME

private class FileOME.MyXMLHandler extends DefaultHandler
Private class used by the parser to parse the XML file.
  • Field Details

    • currentKey

      String currentKey
      The current XML tag we are parsing.
    • elementBuffer

      String elementBuffer
      The data for the current element being parsed.
    • superKey

      String superKey
      The parent XML tag of the element we are currently parsing.
  • Constructor Details

    • MyXMLHandler

      public MyXMLHandler()
      Create a handler to fill out the image info in the parent class from the xml header data.
  • Method Details

    • characters

      public void characters(char[] ch, int start, int length)
      Text data callback from parser. If the parser is not validating, this method can report whitespace. We ignore strings that are entirely whitespace.
      Specified by:
      characters in interface ContentHandler
      Overrides:
      characters in class DefaultHandler
      Parameters:
      ch - Character array
      start - Start of data in array.
      length - Length of data in array.
    • endDocument

      public void endDocument() throws SAXException
      Handle the end of the XML document. Does nothing.
      Specified by:
      endDocument in interface ContentHandler
      Overrides:
      endDocument in class DefaultHandler
      Throws:
      SAXException - if there is a parser error
    • endElement

      public void endElement(String namespaceURI, String localName, String qName) throws SAXException
      Parser calls this when the end tag of each element is reached. Data collected in the elementbuffer is generally saved to the image info.
      Specified by:
      endElement in interface ContentHandler
      Overrides:
      endElement in class DefaultHandler
      Parameters:
      namespaceURI - the namespace (not used)
      localName - the current tag we are parsing (not used)
      qName - ? (not used)
      Throws:
      SAXException - if there is a problem with the parser
    • skippedEntity

      public void skippedEntity(String name)
      Handle any skipped entities by writing them out to the debug window.
      Specified by:
      skippedEntity in interface ContentHandler
      Overrides:
      skippedEntity in class DefaultHandler
      Parameters:
      name - the skipped entity
    • startElement

      public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
      Parser calls this for each element in a document.
      Specified by:
      startElement in interface ContentHandler
      Overrides:
      startElement in class DefaultHandler
      Parameters:
      namespaceURI - the namespace (not used)
      localName - the current tag we are parsing
      qName - ? (not used)
      atts - attributes for the current tag
      Throws:
      SAXException - if there is a problem with the parser