INRIA & FluxMedia

fr.fluxmedia.tmcontrib.generator
Class AbstractXMLReader

java.lang.Object
  extended by fr.fluxmedia.tmcontrib.generator.AbstractXMLReader
All Implemented Interfaces:
org.xml.sax.XMLReader
Direct Known Subclasses:
CSVXMLReader, CVSLogXMLReader, vcsReader

public abstract class AbstractXMLReader
extends java.lang.Object
implements org.xml.sax.XMLReader

This abstract class implements SAX2 interface XMLReader. It aims to allow the sub-classes to behave like XMLReader implementations. This class is defined in the following book "Java and XSLT" by Eric M. Burke (O'Reilly)

Author:
triolet

Field Summary
private  org.xml.sax.ContentHandler contentHandler
           
private  org.xml.sax.DTDHandler dtdHandler
           
private  org.xml.sax.EntityResolver entityResolver
           
private  org.xml.sax.ErrorHandler errorHandler
           
private  java.util.Map featureMap
           
private  java.util.Map propertyMap
           
 
Constructor Summary
AbstractXMLReader()
           
 
Method Summary
 org.xml.sax.ContentHandler getContentHandler()
          Gets the contentHandler attribute of the AbstractXMLReader object
 org.xml.sax.DTDHandler getDTDHandler()
          Gets the dTDHandler attribute of the AbstractXMLReader object
 org.xml.sax.EntityResolver getEntityResolver()
          Gets the entityResolver attribute of the AbstractXMLReader object
 org.xml.sax.ErrorHandler getErrorHandler()
          Gets the errorHandler attribute of the AbstractXMLReader object
 boolean getFeature(java.lang.String name)
          Gets the feature attribute of the AbstractXMLReader object
 java.lang.Object getProperty(java.lang.String name)
          Gets the property attribute of the AbstractXMLReader object
abstract  void parse(org.xml.sax.InputSource input)
          Sub-classes have to implement this method in order to produce SAX2 events.
 void parse(java.lang.String systemId)
          Parses the file represented by the systemId
 void setContentHandler(org.xml.sax.ContentHandler contentHandler)
          Sets the contentHandler attribute of the AbstractXMLReader object
 void setDTDHandler(org.xml.sax.DTDHandler dtdHandler)
          Sets the dTDHandler attribute of the AbstractXMLReader object
 void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
          Sets the entityResolver attribute of the AbstractXMLReader object
 void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
          Sets the errorHandler attribute of the AbstractXMLReader object
 void setFeature(java.lang.String name, boolean value)
          Sets the feature attribute of the AbstractXMLReader object
 void setProperty(java.lang.String name, java.lang.Object value)
          Sets the property attribute of the AbstractXMLReader object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

featureMap

private java.util.Map featureMap

propertyMap

private java.util.Map propertyMap

entityResolver

private org.xml.sax.EntityResolver entityResolver

dtdHandler

private org.xml.sax.DTDHandler dtdHandler

contentHandler

private org.xml.sax.ContentHandler contentHandler

errorHandler

private org.xml.sax.ErrorHandler errorHandler
Constructor Detail

AbstractXMLReader

public AbstractXMLReader()
Method Detail

parse

public abstract void parse(org.xml.sax.InputSource input)
                    throws java.io.IOException,
                           org.xml.sax.SAXException
Sub-classes have to implement this method in order to produce SAX2 events.

Specified by:
parse in interface org.xml.sax.XMLReader
Parameters:
input - The InputSource to parse.
Throws:
java.io.IOException - if the input has not been found
org.xml.sax.SAXException - an exception which can wrap others exceptions

getFeature

public boolean getFeature(java.lang.String name)
                   throws org.xml.sax.SAXNotRecognizedException,
                          org.xml.sax.SAXNotSupportedException
Gets the feature attribute of the AbstractXMLReader object

Specified by:
getFeature in interface org.xml.sax.XMLReader
Parameters:
name - The feature name
Returns:
The feature value
Throws:
org.xml.sax.SAXNotRecognizedException - if the feature is not recognized
org.xml.sax.SAXNotSupportedException - if the feature is not supported

setFeature

public void setFeature(java.lang.String name,
                       boolean value)
                throws org.xml.sax.SAXNotRecognizedException,
                       org.xml.sax.SAXNotSupportedException
Sets the feature attribute of the AbstractXMLReader object

Specified by:
setFeature in interface org.xml.sax.XMLReader
Parameters:
name - The new feature name
value - The new feature value
Throws:
org.xml.sax.SAXNotRecognizedException - if the feature is not recognized
org.xml.sax.SAXNotSupportedException - if the feature is not supported

getProperty

public java.lang.Object getProperty(java.lang.String name)
                             throws org.xml.sax.SAXNotRecognizedException,
                                    org.xml.sax.SAXNotSupportedException
Gets the property attribute of the AbstractXMLReader object

Specified by:
getProperty in interface org.xml.sax.XMLReader
Parameters:
name - The property name
Returns:
The property value
Throws:
org.xml.sax.SAXNotRecognizedException - if the property is not recognized
org.xml.sax.SAXNotSupportedException - if the property is not supported

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
                 throws org.xml.sax.SAXNotRecognizedException,
                        org.xml.sax.SAXNotSupportedException
Sets the property attribute of the AbstractXMLReader object

Specified by:
setProperty in interface org.xml.sax.XMLReader
Parameters:
name - The new property name
value - The new property value
Throws:
org.xml.sax.SAXNotRecognizedException - if the property is not recognized
org.xml.sax.SAXNotSupportedException - if the property is not supported

setEntityResolver

public void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
Sets the entityResolver attribute of the AbstractXMLReader object

Specified by:
setEntityResolver in interface org.xml.sax.XMLReader
Parameters:
entityResolver - The new entityResolver value

getEntityResolver

public org.xml.sax.EntityResolver getEntityResolver()
Gets the entityResolver attribute of the AbstractXMLReader object

Specified by:
getEntityResolver in interface org.xml.sax.XMLReader
Returns:
The entityResolver value

setDTDHandler

public void setDTDHandler(org.xml.sax.DTDHandler dtdHandler)
Sets the dTDHandler attribute of the AbstractXMLReader object

Specified by:
setDTDHandler in interface org.xml.sax.XMLReader
Parameters:
dtdHandler - The new dTDHandler value

getDTDHandler

public org.xml.sax.DTDHandler getDTDHandler()
Gets the dTDHandler attribute of the AbstractXMLReader object

Specified by:
getDTDHandler in interface org.xml.sax.XMLReader
Returns:
The dTDHandler value

setContentHandler

public void setContentHandler(org.xml.sax.ContentHandler contentHandler)
Sets the contentHandler attribute of the AbstractXMLReader object

Specified by:
setContentHandler in interface org.xml.sax.XMLReader
Parameters:
contentHandler - The new contentHandler value

getContentHandler

public org.xml.sax.ContentHandler getContentHandler()
Gets the contentHandler attribute of the AbstractXMLReader object

Specified by:
getContentHandler in interface org.xml.sax.XMLReader
Returns:
The contentHandler value

setErrorHandler

public void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
Sets the errorHandler attribute of the AbstractXMLReader object

Specified by:
setErrorHandler in interface org.xml.sax.XMLReader
Parameters:
errorHandler - The new errorHandler value

getErrorHandler

public org.xml.sax.ErrorHandler getErrorHandler()
Gets the errorHandler attribute of the AbstractXMLReader object

Specified by:
getErrorHandler in interface org.xml.sax.XMLReader
Returns:
The errorHandler value

parse

public void parse(java.lang.String systemId)
           throws java.io.IOException,
                  org.xml.sax.SAXException
Parses the file represented by the systemId

Specified by:
parse in interface org.xml.sax.XMLReader
Parameters:
systemId - The systemID of the file to parse
Throws:
java.io.IOException - if the input has not been found
org.xml.sax.SAXException - an exception which can wrap others exceptions

INRIA & FluxMedia

..no bottom yet...