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:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
- Enclosing class:
FileOME
Private class used by the parser to parse the XML file.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a handler to fill out the image info in the parent class from the xml header data. -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) Text data callback from parser.voidHandle the end of the XML document.voidendElement(String namespaceURI, String localName, String qName) Parser calls this when the end tag of each element is reached.voidskippedEntity(String name) Handle any skipped entities by writing them out to the debug window.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
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, 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
-
Constructor Details
-
MyXMLHandler
public MyXMLHandler()Create a handler to fill out the image info in the parent class from the xml header data.
-
-
Method Details
-
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 interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Parameters:
ch- Character arraystart- Start of data in array.length- Length of data in array.
-
endDocument
Handle the end of the XML document. Does nothing.- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- Throws:
SAXException- if there is a parser error
-
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 parsing (not used)qName- ? (not used)- Throws:
SAXException- if there is a problem with the parser
-
skippedEntity
Handle any skipped entities by writing them out to the debug window.- Specified by:
skippedEntityin interfaceContentHandler- Overrides:
skippedEntityin classDefaultHandler- Parameters:
name- the skipped entity
-
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
-