uk.me.nxg.xoxa.esis
Class EsisParser

java.lang.Object
  extended by uk.me.nxg.xoxa.esis.EsisParser
All Implemented Interfaces:
XMLReader

public class EsisParser
extends Object
implements XMLReader

A parser which can interpret the pseudo-ESIS syntax of EsisHandler. This is most immediately useful for testing, since it allows us to control exactly what SAX stream is given to the normalising functions of EsisHandler, but it is also useful for interconverting between the two syntaxes.

This class, like any XMLReader, acts by turning an input source into a sequence of SAX events.


Constructor Summary
EsisParser()
           
 
Method Summary
 ContentHandler getContentHandler()
           
 DTDHandler getDTDHandler()
           
 EntityResolver getEntityResolver()
           
 ErrorHandler getErrorHandler()
           
 boolean getFeature(String name)
           
 Object getProperty(String name)
           
 void parse(InputSource input)
          Reads a SAX stream in a format based on http://www.jclark.com/sp/sgmlsout.htm, as written by uk.me.nxg.xoxa.esis.
 void parse(String systemId)
           
 void setContentHandler(ContentHandler handler)
           
 void setDTDHandler(DTDHandler handler)
           
 void setEntityResolver(EntityResolver resolver)
           
 void setErrorHandler(ErrorHandler handler)
           
 void setFeature(String name, boolean value)
           
 void setProperty(String name, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EsisParser

public EsisParser()
Method Detail

parse

public void parse(InputSource input)
           throws IOException,
                  SAXException
Reads a SAX stream in a format based on http://www.jclark.com/sp/sgmlsout.htm, as written by uk.me.nxg.xoxa.esis.

The codes that class produces are as below. The extensions to ESIS are marked with a star.

Mprefix uristart prefix mapping*
mprefixend prefix mapping*
Aattname CDATA valuedeclare attribute
Bnamespace localname CDATA valuedeclare namespaced attribute*
(gistart element
[namespace gistart namespaced element*
)giend element
]namespace localnameend namespaced element*
-textcharacter content
=textignorable whitespace*
?pi dataprocessing instruction
Xnameskipped entity*

Specified by:
parse in interface XMLReader
Throws:
IOException
SAXException

parse

public void parse(String systemId)
Specified by:
parse in interface XMLReader

getContentHandler

public ContentHandler getContentHandler()
Specified by:
getContentHandler in interface XMLReader

getDTDHandler

public DTDHandler getDTDHandler()
Specified by:
getDTDHandler in interface XMLReader

getEntityResolver

public EntityResolver getEntityResolver()
Specified by:
getEntityResolver in interface XMLReader

getErrorHandler

public ErrorHandler getErrorHandler()
Specified by:
getErrorHandler in interface XMLReader

getFeature

public boolean getFeature(String name)
Specified by:
getFeature in interface XMLReader

getProperty

public Object getProperty(String name)
                   throws SAXNotRecognizedException
Specified by:
getProperty in interface XMLReader
Throws:
SAXNotRecognizedException

setContentHandler

public void setContentHandler(ContentHandler handler)
Specified by:
setContentHandler in interface XMLReader

setDTDHandler

public void setDTDHandler(DTDHandler handler)
Specified by:
setDTDHandler in interface XMLReader

setEntityResolver

public void setEntityResolver(EntityResolver resolver)
Specified by:
setEntityResolver in interface XMLReader

setErrorHandler

public void setErrorHandler(ErrorHandler handler)
Specified by:
setErrorHandler in interface XMLReader

setFeature

public void setFeature(String name,
                       boolean value)
                throws SAXNotRecognizedException
Specified by:
setFeature in interface XMLReader
Throws:
SAXNotRecognizedException

setProperty

public void setProperty(String name,
                        Object value)
                 throws SAXNotRecognizedException
Specified by:
setProperty in interface XMLReader
Throws:
SAXNotRecognizedException


Copyright © 2015. All rights reserved.