SAX2EventAndErrorProducer
, SAX2EventProducer
Sax2EventFromStaxEventProducer
, Sax2EventFromStaxStreamProducer
public abstract class BaseSax2EventFromStaxProducer extends java.lang.Object implements SAX2EventAndErrorProducer
Sax2EventFromStaxEventProducer
and
Sax2EventFromStaxStreamProducer
. It consumes StAX events and
produces SAX2 events.Constructor | Description |
---|---|
BaseSax2EventFromStaxProducer() |
Modifier and Type | Method | Description |
---|---|---|
static SAX2EventAndErrorProducer |
createSax2EventFromStax(javax.xml.stream.XMLEventReader eventReader) |
|
static SAX2EventAndErrorProducer |
createSax2EventFromStax(javax.xml.stream.XMLStreamReader streamReader) |
|
(package private) abstract void |
doEndPrefixMapping() |
|
(package private) abstract void |
doStartPrefixMapping() |
For every declared namespace in the current event {@link
getContentHandler().startPrefixMapping()} gets invoked.
|
(package private) abstract org.xml.sax.Attributes |
getAttributes() |
|
(package private) abstract char[] |
getCharacters() |
|
org.xml.sax.ContentHandler |
getContentHandler() |
|
org.xml.sax.ErrorHandler |
getErrorHandler() |
|
(package private) abstract javax.xml.stream.Location |
getLocation() |
|
(package private) java.lang.String |
getNonEmpty(java.lang.String string) |
If string equals null this returns an empty string, otherwise it returns
the string
|
java.util.Stack<java.util.List<java.lang.String>> |
getPrefixes() |
|
(package private) abstract javax.xml.namespace.QName |
getQName() |
|
(package private) java.lang.String |
getQName(java.lang.String prefix,
java.lang.String localPart) |
|
protected org.xml.sax.Locator |
getSAXLocator(javax.xml.stream.Location location) |
Gets a
Locator to a given Location . |
(package private) void |
handleCharacters() |
Handles a character event.
|
(package private) void |
handleEndDocument() |
Handles a end document event.
|
(package private) void |
handleEndElement() |
Handles an end element event.
|
(package private) int |
handleEventType(int eventType,
int depth) |
This method takes an eventType and invokes a method to handle that event.
|
(package private) void |
handleSpace() |
Handles a space event.
|
(package private) void |
handleStartDocument() |
Invoke
handleDocumentLocator() and {@link
getContentHandler().startDocument()}; |
(package private) void |
handleStartElement() |
Handles a start element event.
|
(package private) boolean |
isIgnorableWhitespace(char[] chars,
int start,
int length) |
If a chars without leading and trailing whitespaces would be empty, this
method returns true, otherwise false,
|
void |
setContentHandler(org.xml.sax.ContentHandler contentHandler) |
Sets the SAX2 ContentHandler to send SAX 2 events to
|
void |
setErrorHandler(org.xml.sax.ErrorHandler errorHandler) |
Sets the SAX2 ErrorHandler to send SAX 2 errors to
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
start
public static SAX2EventAndErrorProducer createSax2EventFromStax(javax.xml.stream.XMLStreamReader streamReader)
public static SAX2EventAndErrorProducer createSax2EventFromStax(javax.xml.stream.XMLEventReader eventReader)
public void setContentHandler(org.xml.sax.ContentHandler contentHandler)
SAX2EventProducer
setContentHandler
in interface SAX2EventProducer
public void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
SAX2EventAndErrorProducer
setErrorHandler
in interface SAX2EventAndErrorProducer
public java.util.Stack<java.util.List<java.lang.String>> getPrefixes()
public org.xml.sax.ContentHandler getContentHandler()
public org.xml.sax.ErrorHandler getErrorHandler()
int handleEventType(int eventType, int depth) throws org.xml.sax.SAXException
It also takes information about the depth of the read element. Maybe depth changes due to handling that event.
eventType
- The event typedepth
- The current depth of the elementorg.xml.sax.SAXException
void handleStartDocument() throws org.xml.sax.SAXException
handleDocumentLocator()
and {@link
getContentHandler().startDocument()};org.xml.sax.SAXException
void handleEndDocument() throws org.xml.sax.SAXException
Invoke {@link getContentHandler().endDocument()};
org.xml.sax.SAXException
void handleStartElement() throws org.xml.sax.SAXException
Invoke doStartPrefixMapping()
and {@link
getContentHandler().startElement()};
org.xml.sax.SAXException
void handleEndElement() throws org.xml.sax.SAXException
Invoke {@link getContentHandler().endElement()} and
doEndPrefixMapping()
;
org.xml.sax.SAXException
void handleSpace() throws org.xml.sax.SAXException
org.xml.sax.SAXException
void handleCharacters() throws org.xml.sax.SAXException
If chars is ignorable whitespace {@link getContentHandler().ignorableWhitespace will be called. Otherwise {@link getContentHandler().characters()} will be called with characters(char[], 0, length)
org.xml.sax.SAXException
java.lang.String getQName(java.lang.String prefix, java.lang.String localPart)
prefix
- localPart
- boolean isIgnorableWhitespace(char[] chars, int start, int length)
chars
- start
- the offsetlength
- java.lang.String getNonEmpty(java.lang.String string)
string
- the string to checkabstract javax.xml.stream.Location getLocation()
abstract char[] getCharacters()
abstract void doStartPrefixMapping() throws org.xml.sax.SAXException
org.xml.sax.SAXException
abstract void doEndPrefixMapping() throws org.xml.sax.SAXException
org.xml.sax.SAXException
abstract org.xml.sax.Attributes getAttributes()
abstract javax.xml.namespace.QName getQName()
protected org.xml.sax.Locator getSAXLocator(javax.xml.stream.Location location)
Locator
to a given Location
.location
- A Location
Locator
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com