Package gov.nih.mipav.model.file
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
Handle events generated while parsing the Annotation XML file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe current XML tag we are parsing.private StringThe data for the current element being parsed.private Stringname of the fontprivate intsize of the fontprivate intstyle of the font (bold/italic etc)private shortid for the VOIprivate booleanprivate Stringprivate VOIThe VOI that we are building from the XML.private VOITexta temporary VOIText holder which will be added to the VOIVectorprivate final VOIVectorHolds all the VOITexts read inprivate intthe Z dimension of the image -
Constructor Summary
ConstructorsConstructorDescriptionXMLAnnotationHandler(VOIVector voiVector) Construct our custom XML data handler. -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) DOCUMENT ME!voidendElement(String namespaceURI, String localName, String qName) Parser calls this when the end tag of each element is reached.voidstartElement(String namespaceURI, String localName, String qName, Attributes atts) Parser calls this for each element in a document.Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
currentKey
The current XML tag we are parsing. -
elementBuffer
The data for the current element being parsed. -
fontName
name of the font -
fontSize
private int fontSizesize of the font -
fontStyle
private int fontStylestyle of the font (bold/italic etc) -
id
private short idid for the VOI -
voi
The VOI that we are building from the XML. -
voiText
a temporary VOIText holder which will be added to the VOIVector -
voiVector
Holds all the VOITexts read in -
zDim
private int zDimthe Z dimension of the image -
lps
private boolean lps -
name
-
-
Constructor Details
-
XMLAnnotationHandler
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:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Parameters:
ch- char[]start- intlength- int
-
endElement
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:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Parameters:
namespaceURI- the namespace (not used)localName- the current tag we are parsingqName- ? (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:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Parameters:
namespaceURI- the namespace (not used)localName- the current tag we are parsingqName- ? (not used)atts- attributes for the current tag- Throws:
SAXException- if there is a problem with the parser
-