org.eclipse.ercp.jaxp.implForCore
Class SAXParserImpl

java.lang.Object
  extended by javax.xml.parsers.SAXParser
      extended by org.eclipse.ercp.xml.parser.AbstractSAXParserImpl
          extended by org.eclipse.ercp.jaxp.implForCore.SAXParserImpl
All Implemented Interfaces:
Locator, XMLReader

public class SAXParserImpl
extends AbstractSAXParserImpl
implements XMLReader

SAXParser implementation for jclCore and bigger


Field Summary
 
Fields inherited from class org.eclipse.ercp.xml.parser.AbstractSAXParserImpl
ATTEQUAL_STATE, ATTLIST_STATE, ATTNAME_STATE, ATTVALUE_STATE, CDATA_END_STATE, CDATA_END2_STATE, CDATA_STATE, CDATA_VALUE_STATE, CMT2_STATE, CMT3_STATE, CMT4_STATE, CMT5_STATE, currentNSDecl, DOC_STATE, DOCTYPE_STATE, DOCTYPE_VALUE_STATE, DT_DECL_STATE, END_ELEMENT_NAME_STATE, END_ELEMENT_STATE, END_ELEMENT2_STATE, ENDTAG_STATE, fStringInterning, fXmlNSUris, LexicalHandlerID, MISC_STATE, MISC2_STATE, NamespacePrefixesFeature, NamespacesFeature, PROLOG_STATE, REF_STATE, REF2_STATE, REF2NAME_STATE, REFNAME_STATE, START_ELEMENT_STATE, StringInterningFeature, VALUE_STATE, WriteBufferSize, XmlNSUris, XmlOrgFeaturesPrefix, XmlOrgPropertiesPrefix, XPI_ATTEQUAL_STATE, XPI_ATTNAME_STATE, XPI_ATTVALUE_STATE, XPI_DATA_END_STATE, XPI_DATA_STATE, XPI_DATA_VALUE_STATE, XPI_STATE, XPI_TARGET_NAME_STATE, XPI_VALUE_STATE, XPI_XML_END_STATE, XPI_XML_TARGET_STATE
 
Constructor Summary
SAXParserImpl()
           
 
Method Summary
protected  boolean canDoStringInterning()
           
protected  void characters(char[] ch, int start, int length)
          Match the SAX API
protected  void endCDATA()
          Match the SAX2 API: Fire endCDATA event
protected  void endDocument()
          End the parsing
protected  void endElement(java.lang.String qName, java.lang.String namespace, java.lang.String localName)
          Match the SAX API
protected  void endPrefixMapping(NSDeclaration nsDecl)
          Ending prefix Mapping
protected  void fatalError(java.lang.String errorMsg, java.lang.String parameter)
          A fatal error was encountered.
 ContentHandler getContentHandler()
          Return the current content handler.
 DTDHandler getDTDHandler()
          Return the current DTD handler.
 EntityResolver getEntityResolver()
          Return the current entity resolver.
 ErrorHandler getErrorHandler()
          Return the current error handler.
protected  java.lang.Object getLexicalHandler()
           
 Parser getParser()
          Deprecated. Parser class is deprecated, use instead getXMLReader()
protected  java.lang.Object getRecognizedXmlOrgProperty(java.lang.String name)
          By default, we don't support the default properties...
 XMLReader getXMLReader()
          Returns the XMLReader that is encapsulated by the implementation of this class.
 void parse(InputSource is, DefaultHandler dh)
          Parse the content of the given InputStream instance as XML using the specified DefaultHandler.
protected  void processingInstruction(java.lang.String target, java.lang.String data)
          Match the SAX API
 void setContentHandler(ContentHandler contentHandler)
          Allow an application to register a content event handler.
 void setDTDHandler(DTDHandler handler)
          Allow an application to register a DTD event handler.
 void setEntityResolver(EntityResolver resolver)
          Allow an application to register an entity resolver.
 void setErrorHandler(ErrorHandler errorHandler)
          Allow an application to register an error event handler.
protected  void setLexicalHandler(java.lang.Object value)
           
protected  void setRecognizedXmlOrgProperty(java.lang.String name, java.lang.Object value)
          By default, we don't support the default properties...
protected  void startCDATA()
          Match the SAX2 API: Fire startCDATA event
protected  void startDocument()
          Start parsing
protected  void startElement(java.lang.String qName, java.lang.String namespace, java.lang.String localName, AttributesImpl attributes)
          Match the SAX API
protected  void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          Starting prefix mapping
protected  void warning(java.lang.String errorMsg, java.lang.String parameter)
          A warning case was encountered.
 
Methods inherited from class org.eclipse.ercp.xml.parser.AbstractSAXParserImpl
addAttribute, errorMsg, getCharDecoder, getColumnNumber, getCurrentState, getElementLocalName, getFeature, getLineNumber, getProperty, getPublicId, getSystemId, getWriteBufferAsString, isNamespaceAware, isValidating, parse, parse, parseNextCharacter, resetParser, setCharDecoder, setFeature, setNamespaceAware, setProperty
 
Methods inherited from class javax.xml.parsers.SAXParser
parse, parse, parse, parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.XMLReader
getFeature, getProperty, parse, parse, setFeature, setProperty
 

Constructor Detail

SAXParserImpl

public SAXParserImpl()
Method Detail

fatalError

protected void fatalError(java.lang.String errorMsg,
                          java.lang.String parameter)
                   throws SAXException
Description copied from class: AbstractSAXParserImpl
A fatal error was encountered.

Specified by:
fatalError in class AbstractSAXParserImpl
Throws:
SAXException

warning

protected void warning(java.lang.String errorMsg,
                       java.lang.String parameter)
                throws SAXException
Description copied from class: AbstractSAXParserImpl
A warning case was encountered.

Specified by:
warning in class AbstractSAXParserImpl
Throws:
SAXException

canDoStringInterning

protected boolean canDoStringInterning()
Specified by:
canDoStringInterning in class AbstractSAXParserImpl

endPrefixMapping

protected void endPrefixMapping(NSDeclaration nsDecl)
                         throws SAXException
Description copied from class: AbstractSAXParserImpl
Ending prefix Mapping

Specified by:
endPrefixMapping in class AbstractSAXParserImpl
Throws:
SAXException

startPrefixMapping

protected void startPrefixMapping(java.lang.String prefix,
                                  java.lang.String uri)
                           throws SAXException
Description copied from class: AbstractSAXParserImpl
Starting prefix mapping

Specified by:
startPrefixMapping in class AbstractSAXParserImpl
Throws:
SAXException

characters

protected void characters(char[] ch,
                          int start,
                          int length)
                   throws SAXException
Description copied from class: AbstractSAXParserImpl
Match the SAX API

Specified by:
characters in class AbstractSAXParserImpl
Throws:
SAXException

startElement

protected void startElement(java.lang.String qName,
                            java.lang.String namespace,
                            java.lang.String localName,
                            AttributesImpl attributes)
                     throws SAXException
Description copied from class: AbstractSAXParserImpl
Match the SAX API

Specified by:
startElement in class AbstractSAXParserImpl
Throws:
SAXException

endElement

protected void endElement(java.lang.String qName,
                          java.lang.String namespace,
                          java.lang.String localName)
                   throws SAXException
Description copied from class: AbstractSAXParserImpl
Match the SAX API

Specified by:
endElement in class AbstractSAXParserImpl
Throws:
SAXException

processingInstruction

protected void processingInstruction(java.lang.String target,
                                     java.lang.String data)
                              throws SAXException
Description copied from class: AbstractSAXParserImpl
Match the SAX API

Specified by:
processingInstruction in class AbstractSAXParserImpl
Throws:
SAXException

startDocument

protected void startDocument()
                      throws SAXException
Start parsing

Specified by:
startDocument in class AbstractSAXParserImpl
Throws:
SAXException

endDocument

protected void endDocument()
                    throws SAXException
End the parsing

Specified by:
endDocument in class AbstractSAXParserImpl
Throws:
SAXException

parse

public void parse(InputSource is,
                  DefaultHandler dh)
           throws SAXException,
                  java.io.IOException
Parse the content of the given InputStream instance as XML using the specified DefaultHandler.

Specified by:
parse in class SAXParser
Parameters:
is - - InputStream containing the content to be parsed.
dh - - The SAX DefaultHandler to use.
Throws:
java.io.IOException - - If any IO errors occur.
java.lang.IllegalArgumentException - - If the given InputStream is null.
SAXException - - If the underlying parser throws a SAXException while parsing.

getXMLReader

public XMLReader getXMLReader()
                       throws SAXException
Description copied from class: SAXParser
Returns the XMLReader that is encapsulated by the implementation of this class.

Specified by:
getXMLReader in class SAXParser
Returns:
The XMLReader that is encapsulated by the implementation of this class.
Throws:
SAXException

getParser

public Parser getParser()
                 throws SAXException
Deprecated. Parser class is deprecated, use instead getXMLReader()

Returns the SAX parser that is encapsultated by the implementation of this class.

Specified by:
getParser in class SAXParser
Returns:
The SAX parser that is encapsultated by the implementation of this class.
Throws:
SAXException

setContentHandler

public void setContentHandler(ContentHandler contentHandler)
Description copied from interface: XMLReader
Allow an application to register a content event handler.

If the application does not register a content handler, all content events reported by the SAX parser will be silently ignored.

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Specified by:
setContentHandler in interface XMLReader
Parameters:
contentHandler - The content handler.
See Also:
XMLReader.setContentHandler(ContentHandler)

getContentHandler

public ContentHandler getContentHandler()
Description copied from interface: XMLReader
Return the current content handler.

Specified by:
getContentHandler in interface XMLReader
Returns:
The current content handler, or null if none has been registered.
See Also:
XMLReader.getContentHandler()

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)
Description copied from interface: XMLReader
Allow an application to register an error event handler.

If the application does not register an error handler, all error events reported by the SAX parser will be silently ignored; however, normal processing may not continue. It is highly recommended that all SAX applications implement an error handler to avoid unexpected bugs.

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Specified by:
setErrorHandler in interface XMLReader
Parameters:
errorHandler - The error handler.
See Also:
XMLReader.setErrorHandler(ErrorHandler)

getErrorHandler

public ErrorHandler getErrorHandler()
Description copied from interface: XMLReader
Return the current error handler.

Specified by:
getErrorHandler in interface XMLReader
Returns:
The current error handler, or null if none has been registered.
See Also:
XMLReader.getErrorHandler()

setDTDHandler

public void setDTDHandler(DTDHandler handler)
Description copied from interface: XMLReader
Allow an application to register a DTD event handler.

If the application does not register a DTD handler, all DTD events reported by the SAX parser will be silently ignored.

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Specified by:
setDTDHandler in interface XMLReader
Parameters:
handler - The DTD handler.
See Also:
XMLReader.setDTDHandler(DTDHandler)

getDTDHandler

public DTDHandler getDTDHandler()
Description copied from interface: XMLReader
Return the current DTD handler.

Specified by:
getDTDHandler in interface XMLReader
Returns:
The current DTD handler, or null if none has been registered.
See Also:
XMLReader.getDTDHandler()

setEntityResolver

public void setEntityResolver(EntityResolver resolver)
Description copied from interface: XMLReader
Allow an application to register an entity resolver.

If the application does not register an entity resolver, the XMLReader will perform its own default resolution.

Applications may register a new or different resolver in the middle of a parse, and the SAX parser must begin using the new resolver immediately.

Specified by:
setEntityResolver in interface XMLReader
Parameters:
resolver - The entity resolver.
See Also:
XMLReader.setEntityResolver(EntityResolver)

getEntityResolver

public EntityResolver getEntityResolver()
Description copied from interface: XMLReader
Return the current entity resolver.

Specified by:
getEntityResolver in interface XMLReader
Returns:
The current entity resolver, or null if none has been registered.
See Also:
XMLReader.getEntityResolver()

setLexicalHandler

protected void setLexicalHandler(java.lang.Object value)

getRecognizedXmlOrgProperty

protected java.lang.Object getRecognizedXmlOrgProperty(java.lang.String name)
                                                throws SAXNotSupportedException
Description copied from class: AbstractSAXParserImpl
By default, we don't support the default properties...

Overrides:
getRecognizedXmlOrgProperty in class AbstractSAXParserImpl
Throws:
SAXNotSupportedException

setRecognizedXmlOrgProperty

protected void setRecognizedXmlOrgProperty(java.lang.String name,
                                           java.lang.Object value)
                                    throws SAXNotSupportedException
Description copied from class: AbstractSAXParserImpl
By default, we don't support the default properties...

Overrides:
setRecognizedXmlOrgProperty in class AbstractSAXParserImpl
Throws:
SAXNotSupportedException

getLexicalHandler

protected java.lang.Object getLexicalHandler()

startCDATA

protected void startCDATA()
                   throws SAXException
Description copied from class: AbstractSAXParserImpl
Match the SAX2 API: Fire startCDATA event

Specified by:
startCDATA in class AbstractSAXParserImpl
Throws:
SAXException

endCDATA

protected void endCDATA()
                 throws SAXException
Description copied from class: AbstractSAXParserImpl
Match the SAX2 API: Fire endCDATA event

Specified by:
endCDATA in class AbstractSAXParserImpl
Throws:
SAXException