Class GraphMLFilter
java.lang.Object
org.xml.sax.helpers.XMLFilterImpl
org.graffiti.plugins.ios.importers.graphml.parser.GraphMLFilter
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
,XMLFilter
,XMLReader
public class GraphMLFilter extends XMLFilterImpl
Class
GraphMLFilter
processes the SAX events generated by the
parser and builds the graph according to the events. In that sense, this
class is the heart of the graphML reading library.- Author:
- ruediger
-
Constructor Summary
Constructors Constructor Description GraphMLFilter(XMLReader parent, Graph graph)
Constructs a newGraphMLFilter
. -
Method Summary
Modifier and Type Method Description void
characters(char[] ch, int start, int length)
Filter a character data event.void
endElement(String uri, String localName, String qName)
Filter an end element event.void
startElement(String uri, String localName, String qName, Attributes atts)
Filter a start element event.Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
endDocument, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
GraphMLFilter
Constructs a newGraphMLFilter
.- Parameters:
parent
- the parentXMLReader
.graph
- theGraph
to which to add the read in data.
-
-
Method Details
-
characters
public void characters(char[] ch, int start, int length)Filter a character data event. This method assumes that the character data is not split into multiple events. Depending on whether the event belongs to a default attribute value declaration or a usual attribute value declaration the corrsponding attribute value will be set.- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classXMLFilterImpl
- Parameters:
ch
- an array of characters.start
- the starting position in the array.length
- the number of characters to use from the array.
-
endElement
Filter an end element event. Depending on the kind of element certain states of the filter will be reset.- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classXMLFilterImpl
- Parameters:
uri
- the element's Namespace URI, or the empty string.localName
- the element's local name, or the empty string.qName
- the element's qualified (prefixed) name, or the empty string.
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXExceptionFilter a start element event. Depending on the kind of attribute either an element will be added to the graph or the filter is prepared to modify the graph appropriately depending on the next coming events.- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classXMLFilterImpl
- Parameters:
uri
- the element's Namespace URI, or the empty string.localName
- the element's local name, or the empty string.qName
- the element's qualified (prefixed) name, or the empty string.atts
- the element's attributes.- Throws:
SAXException
- the client may throw an exception during processing.
-