de.uka.algo.io
Class JungGraphMLFileHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by edu.uci.ics.jung.io.GraphMLFileHandler
          extended by de.uka.algo.io.JungGraphMLFileHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class JungGraphMLFileHandler
extends edu.uci.ics.jung.io.GraphMLFileHandler

A GraphML file handler to parse simple GraphML files. More or less a replacement for jung.io.GraphMLFileHandler because it does not handle data elements.

Author:
stm

Constructor Summary
JungGraphMLFileHandler()
           
 
Method Summary
 void characters(char[] ch, int start, int length)
          This method is called whenever the SaX parser encounters character content inside a tag
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          This method is called whenever the SaX parser encounters a closing tag
static edu.uci.ics.jung.graph.Graph loadGraphFile(java.io.File filename)
          Deprecated. Use JungIOUtils.loadGraphFile
static edu.uci.ics.jung.graph.Graph loadGraphFile(java.net.URL url)
          Deprecated. Use JungIOUtils.loadGraphFile
static edu.uci.ics.jung.graph.Graph loadGraphResource(java.lang.String filename)
          Deprecated. Use JungIOUtils.loadGraphResource
 void startElement(java.lang.String lName, java.lang.String namespaceURI, java.lang.String qName, org.xml.sax.Attributes attrs)
          This method is called whenever the SaX parser encounters an opening tag
static void writeGraphFile(edu.uci.ics.jung.graph.Graph graph, java.io.File url)
          Deprecated. Use JungIOUtils.writeGraphFile
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JungGraphMLFileHandler

public JungGraphMLFileHandler()
Method Detail

loadGraphFile

@Deprecated
public static edu.uci.ics.jung.graph.Graph loadGraphFile(java.io.File filename)
                                                  throws java.io.IOException
Deprecated. Use JungIOUtils.loadGraphFile

Loads a Graph from a GraphML file.

Parameters:
filename - The name of the GraphML file to load
Returns:
A Graph containing the graph described in the file.
Throws:
java.io.IOException - if file is not found

loadGraphFile

@Deprecated
public static edu.uci.ics.jung.graph.Graph loadGraphFile(java.net.URL url)
                                                  throws java.io.IOException
Deprecated. Use JungIOUtils.loadGraphFile

Loads a Graph from a GraphML file.

Parameters:
url - The name of the GraphML file to load
Returns:
A Graph containing the graph described in the file.
Throws:
java.io.IOException - if file is not found

loadGraphResource

@Deprecated
public static edu.uci.ics.jung.graph.Graph loadGraphResource(java.lang.String filename)
                                                      throws java.io.IOException
Deprecated. Use JungIOUtils.loadGraphResource

Loads a Graph from a GraphML resource. This methods tries to find the resource specified by filename and load the corresponding GraphML file resource.

Parameters:
filename - The name of the GraphML file to load
Returns:
A Graph containing the graph described in the file
Throws:
java.io.IOException - if resource is not found

writeGraphFile

@Deprecated
public static void writeGraphFile(edu.uci.ics.jung.graph.Graph graph,
                                             java.io.File url)
                           throws java.io.IOException
Deprecated. Use JungIOUtils.writeGraphFile

Writes a Jung Graph to a file.

Parameters:
graph - A Jung Graph
url - location of the output file
Throws:
java.io.IOException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
This method is called whenever the SaX parser encounters a closing tag

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

characters

public void characters(char[] ch,
                       int start,
                       int length)
This method is called whenever the SaX parser encounters character content inside a tag

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
See Also:
ContentHandler.characters(char[], int, int)

startElement

public void startElement(java.lang.String lName,
                         java.lang.String namespaceURI,
                         java.lang.String qName,
                         org.xml.sax.Attributes attrs)
                  throws org.xml.sax.SAXException
This method is called whenever the SaX parser encounters an opening tag

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class edu.uci.ics.jung.io.GraphMLFileHandler
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)