Package gov.nih.mipav.model.file
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
Handle events generated while parsing the XML file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Vector<WildMagic.LibFoundation.Mathematics.Vector3f> The contours of the VOI we are building.private StringThe current XML tag we are parsing.private StringThe data for the current element being parsed.private booleanThe default is to read the voi coodinates as LPS coordinates.private final VOIThe VOI that we are building from the XML. -
Constructor Summary
ConstructorsConstructorDescriptionXMLCoordHandler(VOI voi) Construct our custom XML data handler.XMLCoordHandler(VOI voi, boolean isLPS) 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
-
contourVector
The contours of the VOI we are building. -
currentKey
The current XML tag we are parsing. -
elementBuffer
The data for the current element being parsed. -
voi
The VOI that we are building from the XML. -
isLPS
private boolean isLPSThe default is to read the voi coodinates as LPS coordinates.
-
-
Constructor Details
-
XMLCoordHandler
Construct our custom XML data handler.- Parameters:
voi- the VOI we should build from the XML file data
-
XMLCoordHandler
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:
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
-