org.globus.cog.gui.grapheditor.util
Class XMLToGraph

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.globus.cog.gui.grapheditor.util.XMLToGraph
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class XMLToGraph
extends DefaultHandler

Loads a hypergraph from an XML document.


Constructor Summary
XMLToGraph(NodeComponent rootNode, LoadUpdateListener l)
           
 
Method Summary
 void characters(char[] chars, int start, int len)
          Text inside XML tags is stored inside the "_text_" property if it exists.
static Object deserialize(String s, Class propClass)
          deserializes an object from a base 64 string.
 void endDocument()
           
 void endElement(String uri, String localName, String qName)
           
 void error(SAXParseException e)
           
 void fatalError(SAXParseException e)
           
 String getFileName()
           
static void read(NodeComponent node, Reader r, boolean useLocator, LoadUpdateListener l)
           
static void read(NodeComponent node, Reader r, boolean useLocator, String fileName, LoadUpdateListener l)
          Constructs a hierarchical graph starting from the specified node and reading the XML document from the specified reader
static void read(NodeComponent node, Reader r, LoadUpdateListener l)
           
static void read(NodeComponent node, String fileName, boolean useLocator, LoadUpdateListener l)
           
 void setDocumentLocator(Locator locator)
           
 void setFileName(String fileName)
           
 void setUseLocator(boolean useLocator)
           
 void startDocument()
           
 void startElement(String namespaceURI, String sName, String qName, Attributes attr)
           
 void warning(SAXParseException e)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLToGraph

public XMLToGraph(NodeComponent rootNode,
                  LoadUpdateListener l)
Method Detail

read

public static void read(NodeComponent node,
                        String fileName,
                        boolean useLocator,
                        LoadUpdateListener l)
                 throws FileNotFoundException
Throws:
FileNotFoundException

read

public static void read(NodeComponent node,
                        Reader r,
                        LoadUpdateListener l)

read

public static void read(NodeComponent node,
                        Reader r,
                        boolean useLocator,
                        LoadUpdateListener l)

read

public static void read(NodeComponent node,
                        Reader r,
                        boolean useLocator,
                        String fileName,
                        LoadUpdateListener l)
Constructs a hierarchical graph starting from the specified node and reading the XML document from the specified reader

Parameters:
node -
r -

startDocument

public void startDocument()
                   throws SAXException
Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException
Throws:
SAXException

startElement

public void startElement(String namespaceURI,
                         String sName,
                         String qName,
                         Attributes attr)
                  throws SAXException
Throws:
SAXException

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException
Throws:
SAXException

warning

public void warning(SAXParseException e)
             throws SAXException
Throws:
SAXException

error

public void error(SAXParseException e)
           throws SAXException
Throws:
SAXException

fatalError

public void fatalError(SAXParseException e)
                throws SAXException
Throws:
SAXException

characters

public void characters(char[] chars,
                       int start,
                       int len)
Text inside XML tags is stored inside the "_text_" property if it exists. Components who want to get the text inside tags should have a _text_ property added.

Parameters:
chars -
start -
len -

deserialize

public static Object deserialize(String s,
                                 Class propClass)
                          throws Exception
deserializes an object from a base 64 string.

Parameters:
s -
Returns:
@throws Exception
Throws:
Exception

setDocumentLocator

public void setDocumentLocator(Locator locator)

setUseLocator

public void setUseLocator(boolean useLocator)

getFileName

public String getFileName()

setFileName

public void setFileName(String fileName)