Top Fields Constructors Methods
com.sun.org.apache.xalan.internal.xsltc.trax

public Class StAXEvent2SAX

extends Object
implements XMLReader, Locator
Class Inheritance
All Implemented Interfaces
org.xml.sax.Locator, org.xml.sax.XMLReader
Imports
com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl, java.io.IOException, java.util.Iterator, javax.xml.namespace.QName, javax.xml.stream.XMLEventReader, .XMLStreamConstants, .XMLStreamException, javax.xml.stream.events.Attribute, .Characters, .EndElement, .Namespace, .ProcessingInstruction, .StartDocument, .StartElement, .XMLEvent, org.xml.sax.Attributes, .ContentHandler, .DTDHandler, .EntityResolver, .ErrorHandler, .InputSource, .Locator, .SAXException, .SAXNotRecognizedException, .SAXNotSupportedException, .XMLReader, org.xml.sax.ext.LexicalHandler, .Locator2, org.xml.sax.helpers.AttributesImpl

Authors
Suresh Kumar, Sunitha Reddy
Since
1.6

Field Summary

Modifier and TypeField and Description
private LexicalHandler
private ContentHandler
private SAXImpl
private String
private final XMLEventReader
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private Attributes

Returns:

the StAX attributes converted to an org.xml.sax.Attributes
getAttributes
(StartElement event)

Get the attributes associated with the given START_ELEMENT StAXevent.

public int
getColumnNumber()

Implements org.xml.sax.Locator.getColumnNumber.

This class is only used internally so this method should never be called.

public ContentHandler
getContentHandler()

Implements org.xml.sax.XMLReader.getContentHandler.

Return the current content handler.

public DTDHandler
getDTDHandler()

Implements org.xml.sax.XMLReader.getDTDHandler.

This class is only used internally so this method should never be called.

public EntityResolver
getEntityResolver()

Implements org.xml.sax.XMLReader.getEntityResolver.

This class is only used internally so this method should never be called.

public ErrorHandler
getErrorHandler()

Implements org.xml.sax.XMLReader.getErrorHandler.

This class is only used internally so this method should never be called.

public boolean
getFeature(String
The feature name, which is a fully-qualified URI.
name
)

Implements org.xml.sax.XMLReader.getFeature.

This class is only used internally so this method should never be called.

public int
getLineNumber()

Implements org.xml.sax.Locator.getLineNumber.

This class is only used internally so this method should never be called.

public Object
getProperty(String
The property name, which is a fully-qualified URI.
name
)

Implements org.xml.sax.XMLReader.getProperty.

This class is only used internally so this method should never be called.

public String
getPublicId()

Implements org.xml.sax.Locator.getPublicId.

This class is only used internally so this method should never be called.

public String
getSystemId()

Implements org.xml.sax.Locator.getSystemId.

This class is only used internally so this method should never be called.

private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
public void
parse(InputSource
The input source for the top-level of the XML document.
unused
)

Implements org.xml.sax.XMLReader.parse.

Parse an XML document.

public void
public void
parse(String
The system identifier (URI).
sysId
)

Implements org.xml.sax.XMLReader.parse.

This class is only used internally so this method should never be called.

public void
setContentHandler(ContentHandler
The content handler.
handler
)

Implements org.xml.sax.XMLReader.setContentHandler.

Allow an application to register a content event handler.

public void
setDTDHandler(DTDHandler
The DTD handler.
handler
)

Implements org.xml.sax.XMLReader.setDTDHandler.

This class is only used internally so this method should never be called.

public void
setEntityResolver(EntityResolver
The entity resolver.
resolver
)

Implements org.xml.sax.XMLReader.setEntityResolver.

This class is only used internally so this method should never be called.

public void
setErrorHandler(ErrorHandler
The error handler.
handler
)

Implements org.xml.sax.XMLReader.setErrorHandler.

This class is only used internally so this method should never be called.

public void
setFeature(String
The feature name, which is a fully-qualified URI.
name
,
boolean
The requested value of the feature (true or false).
value
)

Implements org.xml.sax.XMLReader.setFeature.

This class is only used internally so this method should never be called.

public void
setProperty(String
The property name, which is a fully-qualified URI.
name
,
Object
The requested value for the property.
value
)

Implements org.xml.sax.XMLReader.setProperty.

This class is only used internally so this method should never be called.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_lexback to summary
private LexicalHandler _lex
_saxback to summary
private ContentHandler _sax
_saxImplback to summary
private SAXImpl _saxImpl
encodingback to summary
private String encoding
staxEventReaderback to summary
private final XMLEventReader staxEventReader
versionback to summary
private String version

Constructor Detail

StAXEvent2SAXback to summary
public StAXEvent2SAX(XMLEventReader staxCore)

Method Detail

bridgeback to summary
private void bridge() throws XMLStreamException
getAttributesback to summary
private Attributes getAttributes(StartElement event)

Get the attributes associated with the given START_ELEMENT StAXevent.

Returns:Attributes

the StAX attributes converted to an org.xml.sax.Attributes

getColumnNumberback to summary
public int getColumnNumber()

Implements org.xml.sax.Locator.getColumnNumber.

This class is only used internally so this method should never be called.

Returns:int

Doc from org.xml.sax.Locator.getColumnNumber.

The column number, or -1 if none is available.

getContentHandlerback to summary
public ContentHandler getContentHandler()

Implements org.xml.sax.XMLReader.getContentHandler.

Doc from org.xml.sax.XMLReader.getContentHandler.

Return the current content handler.

Returns:ContentHandler

The current content handler, or null if none has been registered.

getDTDHandlerback to summary
public DTDHandler getDTDHandler()

Implements org.xml.sax.XMLReader.getDTDHandler.

This class is only used internally so this method should never be called.

Returns:DTDHandler

Doc from org.xml.sax.XMLReader.getDTDHandler.

The current DTD handler, or null if none has been registered.

getEntityResolverback to summary
public EntityResolver getEntityResolver()

Implements org.xml.sax.XMLReader.getEntityResolver.

This class is only used internally so this method should never be called.

Returns:EntityResolver

Doc from org.xml.sax.XMLReader.getEntityResolver.

The current entity resolver, or null if none has been registered.

getErrorHandlerback to summary
public ErrorHandler getErrorHandler()

Implements org.xml.sax.XMLReader.getErrorHandler.

This class is only used internally so this method should never be called.

Returns:ErrorHandler

Doc from org.xml.sax.XMLReader.getErrorHandler.

The current error handler, or null if none has been registered.

getFeatureback to summary
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException

Implements org.xml.sax.XMLReader.getFeature.

This class is only used internally so this method should never be called.

Parameters
name:String

Doc from org.xml.sax.XMLReader.getFeature.

The feature name, which is a fully-qualified URI.

Returns:boolean

Doc from org.xml.sax.XMLReader.getFeature.

The current value of the feature (true or false).

Exceptions
SAXNotRecognizedException:

Doc from org.xml.sax.XMLReader.getFeature.

If the feature value can't be assigned or retrieved.

SAXNotSupportedException:

Doc from org.xml.sax.XMLReader.getFeature.

When the XMLReader recognizes the feature name but cannot determine its value at this time.

getLineNumberback to summary
public int getLineNumber()

Implements org.xml.sax.Locator.getLineNumber.

This class is only used internally so this method should never be called.

Returns:int

Doc from org.xml.sax.Locator.getLineNumber.

The line number, or -1 if none is available.

getPropertyback to summary
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException

Implements org.xml.sax.XMLReader.getProperty.

This class is only used internally so this method should never be called.

Parameters
name:String

Doc from org.xml.sax.XMLReader.getProperty.

The property name, which is a fully-qualified URI.

Returns:Object

Doc from org.xml.sax.XMLReader.getProperty.

The current value of the property.

Exceptions
SAXNotRecognizedException:

Doc from org.xml.sax.XMLReader.getProperty.

If the property value can't be assigned or retrieved.

SAXNotSupportedException:

Doc from org.xml.sax.XMLReader.getProperty.

When the XMLReader recognizes the property name but cannot determine its value at this time.

getPublicIdback to summary
public String getPublicId()

Implements org.xml.sax.Locator.getPublicId.

This class is only used internally so this method should never be called.

Returns:String

Doc from org.xml.sax.Locator.getPublicId.

A string containing the public identifier, or null if none is available.

getSystemIdback to summary
public String getSystemId()

Implements org.xml.sax.Locator.getSystemId.

This class is only used internally so this method should never be called.

Returns:String

Doc from org.xml.sax.Locator.getSystemId.

A string containing the system identifier, or null if none is available.

handleAttributeback to summary
private void handleAttribute()
handleCDATAback to summary
private void handleCDATA()
handleCharactersback to summary
private void handleCharacters(Characters event) throws XMLStreamException
handleCommentback to summary
private void handleComment()
handleDTDback to summary
private void handleDTD()
handleEndDocumentback to summary
private void handleEndDocument() throws SAXException
handleEndElementback to summary
private void handleEndElement(EndElement event) throws XMLStreamException
handleEntityDeclback to summary
private void handleEntityDecl()
handleEntityReferenceback to summary
private void handleEntityReference()
handleNamespaceback to summary
private void handleNamespace()
handleNotationDeclback to summary
private void handleNotationDecl()
handlePIback to summary
private void handlePI(ProcessingInstruction event) throws XMLStreamException
handleSpaceback to summary
private void handleSpace()
handleStartDocumentback to summary
private void handleStartDocument(final XMLEvent event) throws SAXException
handleStartElementback to summary
private void handleStartElement(StartElement event) throws XMLStreamException
parseback to summary
public void parse(InputSource unused) throws IOException, SAXException

Implements org.xml.sax.XMLReader.parse.

Doc from org.xml.sax.XMLReader.parse.

Parse an XML document.

The application can use this method to instruct the XML reader to begin parsing an XML document from any valid input source (a character stream, a byte stream, or a URI).

Applications may not invoke this method while a parse is in progress (they should create a new XMLReader instead for each nested XML document). Once a parse is complete, an application may reuse the same XMLReader object, possibly with a different input source. Configuration of the XMLReader object (such as handler bindings and values established for feature flags and properties) is unchanged by completion of a parse, unless the definition of that aspect of the configuration explicitly specifies other behavior. (For example, feature flags or properties exposing characteristics of the document being parsed.)

During the parse, the XMLReader will provide information about the XML document through the registered event handlers.

This method is synchronous: it will not return until parsing has ended. If a client application wants to terminate parsing early, it should throw an exception.

Parameters
unused:InputSource

The input source for the top-level of the XML document.

Exceptions
IOException:
An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
SAXException:
Any SAX exception, possibly wrapping another exception.
parseback to summary
public void parse() throws IOException, SAXException, XMLStreamException
parseback to summary
public void parse(String sysId) throws IOException, SAXException

Implements org.xml.sax.XMLReader.parse.

This class is only used internally so this method should never be called.

Parameters
sysId:String

Doc from org.xml.sax.XMLReader.parse.

The system identifier (URI).

Exceptions
IOException:

Doc from org.xml.sax.XMLReader.parse.

An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.

SAXException:

Doc from org.xml.sax.XMLReader.parse.

Any SAX exception, possibly wrapping another exception.

setContentHandlerback to summary
public void setContentHandler(ContentHandler handler) throws NullPointerException

Implements org.xml.sax.XMLReader.setContentHandler.

Doc from org.xml.sax.XMLReader.setContentHandler.

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.

Parameters
handler:ContentHandler

The content handler.

setDTDHandlerback to summary
public void setDTDHandler(DTDHandler handler) throws NullPointerException

Implements org.xml.sax.XMLReader.setDTDHandler.

This class is only used internally so this method should never be called.

Parameters
handler:DTDHandler

Doc from org.xml.sax.XMLReader.setDTDHandler.

The DTD handler.

setEntityResolverback to summary
public void setEntityResolver(EntityResolver resolver) throws NullPointerException

Implements org.xml.sax.XMLReader.setEntityResolver.

This class is only used internally so this method should never be called.

Parameters
resolver:EntityResolver

Doc from org.xml.sax.XMLReader.setEntityResolver.

The entity resolver.

setErrorHandlerback to summary
public void setErrorHandler(ErrorHandler handler) throws NullPointerException

Implements org.xml.sax.XMLReader.setErrorHandler.

This class is only used internally so this method should never be called.

Parameters
handler:ErrorHandler

Doc from org.xml.sax.XMLReader.setErrorHandler.

The error handler.

setFeatureback to summary
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException

Implements org.xml.sax.XMLReader.setFeature.

This class is only used internally so this method should never be called.

Parameters
name:String

Doc from org.xml.sax.XMLReader.setFeature.

The feature name, which is a fully-qualified URI.

value:boolean

Doc from org.xml.sax.XMLReader.setFeature.

The requested value of the feature (true or false).

Exceptions
SAXNotRecognizedException:

Doc from org.xml.sax.XMLReader.setFeature.

If the feature value can't be assigned or retrieved.

SAXNotSupportedException:

Doc from org.xml.sax.XMLReader.setFeature.

When the XMLReader recognizes the feature name but cannot set the requested value.

setPropertyback to summary
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException

Implements org.xml.sax.XMLReader.setProperty.

This class is only used internally so this method should never be called.

Parameters
name:String

Doc from org.xml.sax.XMLReader.setProperty.

The property name, which is a fully-qualified URI.

value:Object

Doc from org.xml.sax.XMLReader.setProperty.

The requested value for the property.

Exceptions
SAXNotRecognizedException:

Doc from org.xml.sax.XMLReader.setProperty.

If the property value can't be assigned or retrieved.

SAXNotSupportedException:

Doc from org.xml.sax.XMLReader.setProperty.

When the XMLReader recognizes the property name but cannot set the requested value.