|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavanet.staxutils.XMLEventConsumerDelegate
public class XMLEventConsumerDelegate
Writes all events to a wrapped XMLEventConsumer
, and provides
convenience methods for creating events written to the internal consumer.
Constructor Summary | |
---|---|
XMLEventConsumerDelegate(XMLEventConsumer consumer)
|
|
XMLEventConsumerDelegate(XMLEventConsumer consumer,
XMLEventFactory factory)
|
Method Summary | |
---|---|
void |
add(XMLEvent event)
|
void |
addCData(String content)
Creates and adds a CDATA Characters event. |
void |
addComment(String comment)
Creates and adds a Comment event. |
void |
addDTD(String dtd)
Creates and adds a DTD event. |
void |
addEndDocument()
Creates and adds an EndDocument event. |
void |
addEndElement(QName name)
Creates and adds an EndElement event. |
void |
addEndElement(QName name,
Iterator namespaces)
Creates and adds an EndElement event. |
void |
addEndElement(String localName)
Creates and adds an EndElement event. |
void |
addEndElement(String localName,
Iterator namespaces)
Creates and adds an EndElement event. |
void |
addEndElement(String ns,
String localName)
Creates and adds an EndElement event. |
void |
addEndElement(String ns,
String localName,
Iterator namespaces)
Creates and adds an EndElement event. |
void |
addIgnorableSpace(String content)
Creates and adds an ignorable space Characters event. |
void |
addSpace(String content)
Creates and adds a whitespace Characters event. |
void |
addStartDocument()
Creates and adds a StartDocument event. |
void |
addStartDocument(String encoding)
Creates and adds a StartDocument event. |
void |
addStartDocument(String encoding,
String version)
Creates and adds a StartDocument event. |
void |
addStartDocument(String encoding,
String version,
boolean standalone)
Creates and adds a StartDocument event. |
void |
addStartElement(QName name,
Iterator attributes,
Iterator namespaces,
NamespaceContext context)
Creates and adds a StartElement event. |
void |
addStartElement(QName name,
NamespaceContext context)
Creates and adds a StartElement event. |
void |
addStartElement(String localName,
Iterator attributes,
Iterator namespaces,
NamespaceContext context)
Creates and adds a StartElement event. |
void |
addStartElement(String localName,
NamespaceContext context)
Creates and adds a StartElement event. |
void |
addStartElement(String ns,
String localName,
Iterator attributes,
Iterator namespaces,
NamespaceContext context)
Creates and adds a StartElement event. |
void |
addStartElement(String ns,
String localName,
NamespaceContext context)
Creates and adds a StartElement event. |
void |
addText(String content)
Creates and adds a Characters event. |
void |
addTextElement(QName name,
boolean text,
NamespaceContext context)
Adds a boolean text element with no attributes or namespace declarations. |
void |
addTextElement(QName name,
double text,
NamespaceContext context)
Adds a text element with no attributes or namespace declarations. |
void |
addTextElement(QName name,
float text,
NamespaceContext context)
Adds a text element with no attributes or namespace declarations. |
void |
addTextElement(QName name,
int text,
NamespaceContext context)
Adds a text element with no attributes or namespace declarations. |
void |
addTextElement(QName name,
long text,
NamespaceContext context)
Adds a text element with no attributes or namespace declarations. |
void |
addTextElement(QName name,
Number text,
NamespaceContext context)
Adds a text element with no attributes or namespace declarations. |
void |
addTextElement(QName name,
String text,
NamespaceContext context)
Adds a simple text element with no attributes or namespace declarations. |
void |
addTextElement(String name,
boolean text,
NamespaceContext context)
Adds a boolean text element with no attributes or namespace declarations. |
void |
addTextElement(String name,
double text,
NamespaceContext context)
Adds a text element with no attributes or namespace declarations. |
void |
addTextElement(String name,
float text,
NamespaceContext context)
Adds a text element with no attributes or namespace declarations. |
void |
addTextElement(String name,
int text,
NamespaceContext context)
Adds a text element with no attributes or namespace declarations. |
void |
addTextElement(String name,
long text,
NamespaceContext context)
Adds a text element with no attributes or namespace declarations. |
void |
addTextElement(String name,
Number text,
NamespaceContext context)
Adds a text element with no attributes or namespace declarations. |
void |
addTextElement(String name,
String text,
NamespaceContext context)
Adds a simple text element with no attributes or namespace declarations. |
XMLEventConsumer |
getConsumer()
Returns a reference to the underlying XMLEventConsumer to which
events are added. |
XMLEventFactory |
getEventFactory()
Returns a reference to the XMLEventFactory used to construct
events. |
void |
setConsumer(XMLEventConsumer consumer)
Sets the underlying XMLEventConsumer to which events are added. |
void |
setEventFactory(XMLEventFactory factory)
Sets the XMLEventFactory used to construct events. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLEventConsumerDelegate(XMLEventConsumer consumer)
public XMLEventConsumerDelegate(XMLEventConsumer consumer, XMLEventFactory factory)
Method Detail |
---|
public XMLEventConsumer getConsumer()
XMLEventConsumer
to which
events are added.
XMLEventConsumer
to which events are
added.public void setConsumer(XMLEventConsumer consumer)
XMLEventConsumer
to which events are added.
consumer
- The new XMLEventConsumer
.public XMLEventFactory getEventFactory()
XMLEventFactory
used to construct
events.
XMLEventFactory
used to construct events.public void setEventFactory(XMLEventFactory factory)
XMLEventFactory
used to construct events.
factory
- The new XMLEventFactory
.public void add(XMLEvent event) throws XMLStreamException
add
in interface XMLEventConsumer
XMLStreamException
public void addDTD(String dtd) throws XMLStreamException
DTD
event.
dtd
- The DTD content, as per
XMLEventFactory.createDTD(String)
.
XMLStreamException
- If an error occurs adding the event.public void addCData(String content) throws XMLStreamException
Characters
event.
content
- The CDATA content, as per
XMLEventFactory.createCData(String)
.
XMLStreamException
- If an error occurs adding the event.public void addText(String content) throws XMLStreamException
Characters
event.
content
- The text content, as per
XMLEventFactory.createCharacters(String)
.
XMLStreamException
- If an error occurs adding the event.public void addIgnorableSpace(String content) throws XMLStreamException
Characters
event.
content
- The ignorable whitespace, as per
XMLEventFactory.createIgnorableSpace(String)
.
XMLStreamException
- If an error occurs adding the event.public void addSpace(String content) throws XMLStreamException
Characters
event.
content
- The whitespace, as per
XMLEventFactory.createIgnorableSpace(String)
.
XMLStreamException
- If an error occurs adding the event.public void addComment(String comment) throws XMLStreamException
Comment
event.
comment
- The comment text, as per
XMLEventFactory.createComment(String)
.
XMLStreamException
- If an error occurs adding the event.public void addStartDocument() throws XMLStreamException
StartDocument
event.
XMLStreamException
- If an error occurs adding the event.XMLEventFactory.createStartDocument()
public void addStartDocument(String encoding) throws XMLStreamException
StartDocument
event.
encoding
- The encoding to specify in the xml declaration.
XMLStreamException
- If an error occurs adding the event.XMLEventFactory.createStartDocument(String)
public void addStartDocument(String encoding, String version) throws XMLStreamException
StartDocument
event.
encoding
- The encoding to include in the xml declaration.version
- The XML version to include in the xml declaration.
XMLStreamException
- If an error occurs adding the event.XMLEventFactory.createStartDocument(String, String)
public void addStartDocument(String encoding, String version, boolean standalone) throws XMLStreamException
StartDocument
event.
encoding
- The encoding to include in the xml declaration.version
- The XML version to include in the xml declaration.standalone
- The standalone value to include in the xml declaration.
XMLStreamException
- If an error occurs adding the event.XMLEventFactory.createStartDocument(String, String, boolean)
public void addEndDocument() throws XMLStreamException
EndDocument
event.
XMLStreamException
- If an error occurs adding the event.XMLEventFactory.createEndDocument()
public void addStartElement(String localName, NamespaceContext context) throws XMLStreamException
StartElement
event.
localName
- The local name of the element.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding the event.public void addStartElement(String localName, Iterator attributes, Iterator namespaces, NamespaceContext context) throws XMLStreamException
StartElement
event.
localName
- The local name of the element.attributes
- An Iterator
over the element's attributes.namespaces
- An Iterator
over the element's namespaces.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding the event.public void addStartElement(String ns, String localName, NamespaceContext context) throws XMLStreamException
StartElement
event.
ns
- The element's namespace URI.localName
- The local name of the element.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding the event.public void addStartElement(String ns, String localName, Iterator attributes, Iterator namespaces, NamespaceContext context) throws XMLStreamException
StartElement
event.
ns
- The element's namespace URI.localName
- The local name of the element.attributes
- An Iterator
over the element's attributes.namespaces
- An Iterator
over the element's namespaces.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding the event.public void addStartElement(QName name, NamespaceContext context) throws XMLStreamException
StartElement
event.
name
- The qualified element name.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding the event.public void addStartElement(QName name, Iterator attributes, Iterator namespaces, NamespaceContext context) throws XMLStreamException
StartElement
event.
name
- The qualified element name.attributes
- An Iterator
over the element's attributes.namespaces
- An Iterator
over the element's namespaces.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding the event.public void addEndElement(String localName) throws XMLStreamException
EndElement
event.
localName
- The unqualified element name.
XMLStreamException
- If an error occurs adding the event.public void addEndElement(String localName, Iterator namespaces) throws XMLStreamException
EndElement
event.
localName
- The unqualified element name.namespaces
- An Iterator
over the element's namespaces that
are going out of scope.
XMLStreamException
- If an error occurs adding the event.public void addEndElement(String ns, String localName) throws XMLStreamException
EndElement
event.
ns
- The element namespace.localName
- The element name.
XMLStreamException
- If an error occurs adding the event.public void addEndElement(String ns, String localName, Iterator namespaces) throws XMLStreamException
EndElement
event.
ns
- The element namespace.localName
- The element name.namespaces
- An Iterator
over the element's namespaces that
are going out of scope.
XMLStreamException
- If an error occurs adding the event.public void addEndElement(QName name) throws XMLStreamException
EndElement
event.
name
- The element name.
XMLStreamException
- If an error occurs adding the event.XMLEventFactory.createEndElement(QName, Iterator)
public void addEndElement(QName name, Iterator namespaces) throws XMLStreamException
EndElement
event.
name
- The element name.namespaces
- An Iterator
over the element's namespaces that
are going out of scope.
XMLStreamException
- If an error occurs adding the event.XMLEventFactory.createEndElement(QName, Iterator)
public void addTextElement(String name, String text, NamespaceContext context) throws XMLStreamException
name
- The unqualified element name.text
- The text content, which may be null
context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding an event.public void addTextElement(QName name, String text, NamespaceContext context) throws XMLStreamException
name
- The element name.text
- The text content, which may be null
context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding an event.public void addTextElement(String name, boolean text, NamespaceContext context) throws XMLStreamException
name
- The unqualified element name.text
- The boolean content.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding an event.public void addTextElement(QName name, boolean text, NamespaceContext context) throws XMLStreamException
name
- The element name.text
- The boolean content.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding an event.public void addTextElement(String name, int text, NamespaceContext context) throws XMLStreamException
name
- The unqualified element name.text
- The element content.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding an event.public void addTextElement(QName name, int text, NamespaceContext context) throws XMLStreamException
name
- The element name.text
- The element content.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding an event.public void addTextElement(String name, long text, NamespaceContext context) throws XMLStreamException
name
- The unqualified element name.text
- The element content.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding an event.public void addTextElement(QName name, long text, NamespaceContext context) throws XMLStreamException
name
- The element name.text
- The element content.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding an event.public void addTextElement(String name, float text, NamespaceContext context) throws XMLStreamException
name
- The unqualified element name.text
- The element content.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding an event.public void addTextElement(QName name, float text, NamespaceContext context) throws XMLStreamException
name
- The element name.text
- The element content.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding an event.public void addTextElement(String name, double text, NamespaceContext context) throws XMLStreamException
name
- The unqualified element name.text
- The element content.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding an event.public void addTextElement(QName name, double text, NamespaceContext context) throws XMLStreamException
name
- The element name.text
- The element content.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding an event.public void addTextElement(String name, Number text, NamespaceContext context) throws XMLStreamException
name
- The unqualified element name.text
- The element content.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding an event.public void addTextElement(QName name, Number text, NamespaceContext context) throws XMLStreamException
name
- The element name.text
- The element content.context
- The element's NamespaceContext
, or null
.
XMLStreamException
- If an error occurs adding an event.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |