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 Details

    • GraphMLFilter

      public GraphMLFilter​(XMLReader parent, Graph graph)
      Constructs a new GraphMLFilter.
      Parameters:
      parent - the parent XMLReader.
      graph - the Graph 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 interface ContentHandler
      Overrides:
      characters in class XMLFilterImpl
      Parameters:
      ch - an array of characters.
      start - the starting position in the array.
      length - the number of characters to use from the array.
    • endElement

      public void endElement​(String uri, String localName, String qName)
      Filter an end element event. Depending on the kind of element certain states of the filter will be reset.
      Specified by:
      endElement in interface ContentHandler
      Overrides:
      endElement in class XMLFilterImpl
      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 SAXException
      Filter 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 interface ContentHandler
      Overrides:
      startElement in class XMLFilterImpl
      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.