Class FileVOI.XMLCoordHandler

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

private class FileVOI.XMLCoordHandler extends DefaultHandler
Handle events generated while parsing the XML file.
  • Field Details

    • contourVector

      private final Vector<WildMagic.LibFoundation.Mathematics.Vector3f> contourVector
      The contours of the VOI we are building.
    • currentKey

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

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

      private final VOI voi
      The VOI that we are building from the XML.
    • isLPS

      private boolean isLPS
      The default is to read the voi coodinates as LPS coordinates.
  • Constructor Details

    • XMLCoordHandler

      public XMLCoordHandler(VOI voi)
      Construct our custom XML data handler.
      Parameters:
      voi - the VOI we should build from the XML file data
    • XMLCoordHandler

      public XMLCoordHandler(VOI voi, boolean isLPS)
      Construct our custom XML data handler.
      Parameters:
      voi - the VOI we should build from the XML file data
  • Method Details

    • characters

      public void characters(char[] ch, int start, int length)
      DOCUMENT ME!
      Specified by:
      characters in interface ContentHandler
      Overrides:
      characters in class DefaultHandler
      Parameters:
      ch - char[]
      start - int
      length - int
    • 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
      qName - ? (not used)
      Throws:
      SAXException - if there is a problem with the parser
    • 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