Class FileVOI.XMLAnnotationHandler

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

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

    • currentKey

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

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

      private String fontName
      name of the font
    • fontSize

      private int fontSize
      size of the font
    • fontStyle

      private int fontStyle
      style of the font (bold/italic etc)
    • id

      private short id
      id for the VOI
    • voi

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

      private VOIText voiText
      a temporary VOIText holder which will be added to the VOIVector
    • voiVector

      private final VOIVector voiVector
      Holds all the VOITexts read in
    • zDim

      private int zDim
      the Z dimension of the image
    • lps

      private boolean lps
    • name

      private String name
  • Constructor Details

    • XMLAnnotationHandler

      public XMLAnnotationHandler(VOIVector voiVector)
      Construct our custom XML data handler.
      Parameters:
      voiVector - 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