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:
org.xml.sax.ContentHandler,org.xml.sax.DTDHandler,org.xml.sax.EntityResolver,org.xml.sax.ErrorHandler
- Enclosing class:
- FileVOI
private class FileVOI.XMLAnnotationHandler extends org.xml.sax.helpers.DefaultHandlerHandle events generated while parsing the Annotation XML file.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringcurrentKeyThe current XML tag we are parsing.private java.lang.StringelementBufferThe data for the current element being parsed.private java.lang.StringfontNamename of the fontprivate intfontSizesize of the fontprivate intfontStylestyle of the font (bold/italic etc)private shortidid for the VOIprivate booleanlpsprivate java.lang.Stringnameprivate VOIvoiThe VOI that we are building from the XML.private VOITextvoiTexta temporary VOIText holder which will be added to the VOIVectorprivate VOIVectorvoiVectorHolds all the VOITexts read inprivate intzDimthe Z dimension of the image
-
Constructor Summary
Constructors Constructor Description XMLAnnotationHandler(VOIVector voiVector)Construct our custom XML data handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)DOCUMENT ME!voidendElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)Parser calls this when the end tag of each element is reached.voidstartElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)Parser calls this for each element in a document.
-
-
-
Field Detail
-
currentKey
private java.lang.String currentKey
The current XML tag we are parsing.
-
elementBuffer
private java.lang.String elementBuffer
The data for the current element being parsed.
-
fontName
private java.lang.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 java.lang.String name
-
-
Constructor Detail
-
XMLAnnotationHandler
public XMLAnnotationHandler(VOIVector voiVector)
Construct our custom XML data handler.- Parameters:
voiVector- the VOI we should build from the XML file data
-
-
Method Detail
-
characters
public void characters(char[] ch, int start, int length)DOCUMENT ME!- Specified by:
charactersin interfaceorg.xml.sax.ContentHandler- Overrides:
charactersin classorg.xml.sax.helpers.DefaultHandler- Parameters:
ch- char[]start- intlength- int
-
endElement
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXExceptionParser 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 interfaceorg.xml.sax.ContentHandler- Overrides:
endElementin classorg.xml.sax.helpers.DefaultHandler- Parameters:
namespaceURI- the namespace (not used)localName- the current tag we are parsingqName- ? (not used)- Throws:
org.xml.sax.SAXException- if there is a problem with the parser
-
startElement
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXExceptionParser calls this for each element in a document.- Specified by:
startElementin interfaceorg.xml.sax.ContentHandler- Overrides:
startElementin classorg.xml.sax.helpers.DefaultHandler- Parameters:
namespaceURI- the namespace (not used)localName- the current tag we are parsingqName- ? (not used)atts- attributes for the current tag- Throws:
org.xml.sax.SAXException- if there is a problem with the parser
-
-