Package gov.nih.mipav.model.file
Class FileOME.MyXMLHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- gov.nih.mipav.model.file.FileOME.MyXMLHandler
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler,org.xml.sax.DTDHandler,org.xml.sax.EntityResolver,org.xml.sax.ErrorHandler
- Enclosing class:
- FileOME
private class FileOME.MyXMLHandler extends org.xml.sax.helpers.DefaultHandlerPrivate class used by the parser to parse the XML file.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.StringcurrentKeyThe current XML tag we are parsing.(package private) java.lang.StringelementBufferThe data for the current element being parsed.(package private) java.lang.StringsuperKeyThe parent XML tag of the element we are currently parsing.
-
Constructor Summary
Constructors Constructor Description MyXMLHandler()Create a handler to fill out the image info in the parent class from the xml header data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)Text data callback from parser.voidendDocument()Handle the end of the XML document.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.voidskippedEntity(java.lang.String name)Handle any skipped entities by writing them out to the debug window.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.
-
-
-
Method Detail
-
characters
public void characters(char[] ch, int start, int length)Text data callback from parser. If the parser is not validating, this method can report whitespace. We ignore strings that are entirely whitespace.- Specified by:
charactersin interfaceorg.xml.sax.ContentHandler- Overrides:
charactersin classorg.xml.sax.helpers.DefaultHandler- Parameters:
ch- Character arraystart- Start of data in array.length- Length of data in array.
-
endDocument
public void endDocument() throws org.xml.sax.SAXExceptionHandle the end of the XML document. Does nothing.- Specified by:
endDocumentin interfaceorg.xml.sax.ContentHandler- Overrides:
endDocumentin classorg.xml.sax.helpers.DefaultHandler- Throws:
org.xml.sax.SAXException- if there is a parser error
-
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 parsing (not used)qName- ? (not used)- Throws:
org.xml.sax.SAXException- if there is a problem with the parser
-
skippedEntity
public void skippedEntity(java.lang.String name)
Handle any skipped entities by writing them out to the debug window.- Specified by:
skippedEntityin interfaceorg.xml.sax.ContentHandler- Overrides:
skippedEntityin classorg.xml.sax.helpers.DefaultHandler- Parameters:
name- the skipped entity
-
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
-
-