Class MipavGraphXMLContentHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- gov.nih.mipav.view.graphVisualization.MipavGraphXMLContentHandler
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.ErrorHandler
public class MipavGraphXMLContentHandler extends org.xml.sax.helpers.DefaultHandler
Parses the MIPAX Graph XML file.
-
-
Field Summary
Fields Modifier and Type Field Description protected hypergraph.graphApi.Element
currentElement
protected java.lang.StringBuffer
currentText
protected hypergraph.graphApi.Graph
graph
private MipavSAXReader
reader
-
Constructor Summary
Constructors Constructor Description MipavGraphXMLContentHandler()
Creates the content handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
void
endDocument()
void
endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
protected void
endElementEdge()
End Edge element.protected void
endElementGraph()
Ends the Graph.protected void
endElementLabel()
Called when the end of the Label element is found.protected void
endElementNode()
Called when the end of the Node Element is found.MipavSAXReader
getReader()
Returns the MipavSAXReader.void
setReader(MipavSAXReader reader)
Sets the MipavSAXReader.void
startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
protected void
startElementEdge(org.xml.sax.Attributes atts)
Called when the Edge start element is found.protected void
startElementGraph(org.xml.sax.Attributes atts)
Called when the Graph start element is found.protected void
startElementLabel(org.xml.sax.Attributes atts)
Called when the start of the Label element is found.protected void
startElementNode(org.xml.sax.Attributes atts)
Called when the start of a Node Element is found.
-
-
-
Field Detail
-
reader
private MipavSAXReader reader
-
graph
protected hypergraph.graphApi.Graph graph
-
currentElement
protected hypergraph.graphApi.Element currentElement
-
currentText
protected java.lang.StringBuffer currentText
-
-
Method Detail
-
characters
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
- Specified by:
characters
in interfaceorg.xml.sax.ContentHandler
- Overrides:
characters
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
endDocument
public void endDocument() throws org.xml.sax.SAXException
- Specified by:
endDocument
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endDocument
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
- Specified by:
endElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endElement
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
getReader
public MipavSAXReader getReader()
Returns the MipavSAXReader.- Returns:
-
setReader
public void setReader(MipavSAXReader reader)
Sets the MipavSAXReader.- Parameters:
reader
-
-
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.SAXException
- Specified by:
startElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startElement
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
endElementEdge
protected void endElementEdge()
End Edge element.
-
endElementGraph
protected void endElementGraph()
Ends the Graph.
-
endElementLabel
protected void endElementLabel()
Called when the end of the Label element is found.
-
endElementNode
protected void endElementNode()
Called when the end of the Node Element is found.
-
startElementEdge
protected void startElementEdge(org.xml.sax.Attributes atts)
Called when the Edge start element is found.- Parameters:
atts
-
-
startElementGraph
protected void startElementGraph(org.xml.sax.Attributes atts)
Called when the Graph start element is found.- Parameters:
atts
-
-
startElementLabel
protected void startElementLabel(org.xml.sax.Attributes atts)
Called when the start of the Label element is found.- Parameters:
atts
-
-
startElementNode
protected void startElementNode(org.xml.sax.Attributes atts)
Called when the start of a Node Element is found.- Parameters:
atts
-
-
-