|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xml.sax.helpers.DefaultHandler org.apache.cocoon.stax.converter.util.StAXEventContentHandler
public class StAXEventContentHandler
SAX ContentHandler that writes events to a StAX XMLEventConsumer
.
Constructor Summary | |
---|---|
StAXEventContentHandler()
Constructs a default instance with a default event factory. |
|
StAXEventContentHandler(XMLEventConsumer consumer)
Constructs an instance that writes events to the provided XMLEventConsumer. |
|
StAXEventContentHandler(XMLEventConsumer consumer,
XMLEventFactory factory)
Constructs an instance that writes events constructed with the provided XMLEventFactory to the provided XMLEventConsumer |
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
|
void |
comment(char[] ch,
int start,
int length)
|
protected Namespace |
createNamespace(String prefix,
String uri)
|
protected void |
createStartEvents(Attributes attributes,
Collection<?>[] events)
Creates the Namespace and Attribute events associated with a
StartElement . |
void |
endCDATA()
|
void |
endDocument()
|
void |
endDTD()
|
void |
endElement(String uri,
String localName,
String qName)
|
void |
endEntity(String name)
|
void |
endPrefixMapping(String prefix)
|
void |
error(SAXParseException e)
|
void |
fatalError(SAXParseException e)
|
void |
finish()
This method is called after pipeline run - regardless if the run was successful or an exception was thrown. |
Location |
getCurrentLocation()
Calculates the STAX Location from the SAX Locator registered with this
handler. |
XMLEventConsumer |
getEventConsumer()
Returns a reference to the XMLEventConsumer to which events will be written. |
XMLEventFactory |
getEventFactory()
Returns a reference to the XMLEventFactory used to construct events. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
void |
processingInstruction(String target,
String data)
|
protected void |
reportException(String type,
SAXException e)
Used to report a SAXException to the XMLReporter registered with this handler. |
void |
setConfiguration(Map<String,? extends Object> configuration)
Pass component specific configuration parameters to the pipeline component in a generic way. |
void |
setDocumentLocator(Locator locator)
|
void |
setEventConsumer(XMLEventConsumer consumer)
Sets the XMLEventConsumer to which events are written. |
void |
setEventFactory(XMLEventFactory factory)
Sets the XMLEventFactory used to create events. |
void |
setup(Map<String,Object> parameters)
The shared object map for this pipeline run. |
void |
setXMLReporter(XMLReporter reporter)
Sets the XMLReporter to which warning and error messages will be sent. |
void |
startCDATA()
|
void |
startDocument()
|
void |
startDTD(String name,
String publicId,
String systemId)
|
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes)
|
void |
startEntity(String name)
|
void |
startPrefixMapping(String prefix,
String uri)
|
void |
warning(SAXParseException e)
|
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
notationDecl, resolveEntity, skippedEntity, unparsedEntityDecl |
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.ContentHandler |
---|
skippedEntity |
Constructor Detail |
---|
public StAXEventContentHandler()
XMLEventConsumer
via the setEventConsumer(XMLEventConsumer)
method.
public StAXEventContentHandler(XMLEventConsumer consumer)
consumer
- The XMLEventConsumer
to which events will be written.public StAXEventContentHandler(XMLEventConsumer consumer, XMLEventFactory factory)
consumer
- The XMLEventConsumer
to which events will be written.factory
- The XMLEventFactory
used to construct events. If null
, a
default instance will be constructed.Method Detail |
---|
public XMLEventConsumer getEventConsumer()
XMLEventConsumer
to which events will be written.
XMLEventConsumer
to which events will be written.public void setEventConsumer(XMLEventConsumer consumer)
XMLEventConsumer
to which events are written.
consumer
- The XMLEventConsumer
to which events will be written.public XMLEventFactory getEventFactory()
XMLEventFactory
used to construct events.
XMLEventFactory
used to construct events.public void setEventFactory(XMLEventFactory factory)
XMLEventFactory
used to create events.
factory
- The XMLEventFactory
used to create events.public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void endElement(String uri, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void comment(char[] ch, int start, int length) throws SAXException
comment
in interface LexicalHandler
SAXException
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ignorableWhitespace
in interface ContentHandler
ignorableWhitespace
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
processingInstruction
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void endCDATA() throws SAXException
endCDATA
in interface LexicalHandler
SAXException
protected void createStartEvents(Attributes attributes, Collection<?>[] events)
Namespace
and Attribute
events associated with a
StartElement
.
attributes
- The SAX attributes object.events
- An array used to return the two collections of Namespace
and
Attribute
events. The namespaces will be placed at events[0]
and the attributes as events[1]
.protected Namespace createNamespace(String prefix, String uri)
public void setXMLReporter(XMLReporter reporter)
XMLReporter
to which warning and error messages will be sent.
reporter
- The XMLReporter
to notify of errors.public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class org.xml.sax.helpers.DefaultHandler
public Location getCurrentLocation()
Location
from the SAX Locator
registered with this
handler. If no Locator
was provided, then this method will return null
.
public void error(SAXParseException e) throws SAXException
error
in interface ErrorHandler
error
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void fatalError(SAXParseException e) throws SAXException
fatalError
in interface ErrorHandler
fatalError
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void warning(SAXParseException e) throws SAXException
warning
in interface ErrorHandler
warning
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
in interface ContentHandler
endPrefixMapping
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void startCDATA() throws SAXException
startCDATA
in interface LexicalHandler
SAXException
public void endDTD() throws SAXException
endDTD
in interface LexicalHandler
SAXException
public void endEntity(String name) throws SAXException
endEntity
in interface LexicalHandler
SAXException
public void startDTD(String name, String publicId, String systemId) throws SAXException
startDTD
in interface LexicalHandler
SAXException
public void startEntity(String name) throws SAXException
startEntity
in interface LexicalHandler
SAXException
protected void reportException(String type, SAXException e) throws SAXException
SAXException
to the XMLReporter
registered with this handler.
SAXException
public void finish()
PipelineComponent
finish
in interface PipelineComponent
public void setConfiguration(Map<String,? extends Object> configuration)
PipelineComponent
setConfiguration
in interface PipelineComponent
configuration
- The Map
of configuration parameters.public void setup(Map<String,Object> parameters)
PipelineComponent
setup
in interface PipelineComponent
parameters
- A Map
of parameters that are available to all
PipelineComponent
s. This is a modifiable map that can
be changed by this pipeline component.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |