infovis.io
Class AbstractXMLReader

java.lang.Object
  extended by infovis.io.AbstractReader
      extended by infovis.io.AbstractXMLReader
All Implemented Interfaces:
ContentHandler, EntityResolver
Direct Known Subclasses:
GraphMLReader, SimpleXMLTreeReader

public abstract class AbstractXMLReader
extends AbstractReader
implements ContentHandler, EntityResolver

Abstract Reader for XML format.

Version:
$Revision: 1.22 $
Author:
Jean-Daniel Fekete

Constructor Summary
AbstractXMLReader(InputStream in, String name)
          Creates a new AbstractXMLReader object.
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endDocument()
           
 void endElement(String namespaceURI, String localName, String qName)
           
 void endPrefixMapping(String prefix)
           
 void ignorableWhitespace(char[] ch, int start, int length)
           
 boolean load()
          Main method for loading the file.
 void processingInstruction(String target, String data)
           
 InputSource resolveEntity(String publicId, String systemId)
           
 void setDocumentLocator(Locator locator)
           
 void skippedEntity(String name)
           
 void startDocument()
           
 void startElement(String namespaceURI, String localName, String qName, Attributes atts)
           
 void startPrefixMapping(String prefix, String uri)
           
 
Methods inherited from class infovis.io.AbstractReader
close, createColumn, getBufferedReader, getEncoding, getIn, getName, guessFieldType, setEncoding, setIn, setName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractXMLReader

public AbstractXMLReader(InputStream in,
                         String name)
Creates a new AbstractXMLReader object.

Parameters:
in - the InputStream
name - a given name
Method Detail

load

public boolean load()
Description copied from class: AbstractReader
Main method for loading the file. The loading may fail at any point, leaving the table in an indefinite state if the methods returns false.

Specified by:
load in class AbstractReader
Returns:
true if the file has been loaded without error, false otherwise.
See Also:
AbstractReader.load()

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Specified by:
characters in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.characters(char[], int, int)

endDocument

public void endDocument()
                 throws SAXException
Specified by:
endDocument in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.endDocument()

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.endElement(String, String, String)

endPrefixMapping

public void endPrefixMapping(String prefix)
                      throws SAXException
Specified by:
endPrefixMapping in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.endPrefixMapping(String)

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws SAXException
Specified by:
ignorableWhitespace in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.ignorableWhitespace(char[], int, int)

processingInstruction

public void processingInstruction(String target,
                                  String data)
                           throws SAXException
Specified by:
processingInstruction in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.processingInstruction(String, String)

setDocumentLocator

public void setDocumentLocator(Locator locator)
Specified by:
setDocumentLocator in interface ContentHandler
See Also:
ContentHandler.setDocumentLocator(Locator)

skippedEntity

public void skippedEntity(String name)
                   throws SAXException
Specified by:
skippedEntity in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.skippedEntity(String)

startDocument

public void startDocument()
                   throws SAXException
Specified by:
startDocument in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.startDocument()

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.startElement(String, String, String, Attributes)

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
                        throws SAXException
Specified by:
startPrefixMapping in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.startPrefixMapping(String, String)

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws SAXException,
                                 IOException
Specified by:
resolveEntity in interface EntityResolver
Throws:
SAXException
IOException
See Also:
EntityResolver.resolveEntity(String, String)


Copyright © 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.