Class ConfluenceXMLEventWriter
java.lang.Object
com.atlassian.confluence.content.render.xhtml.ConfluenceXMLEventWriter
- All Implemented Interfaces:
XMLEventConsumer,XMLEventWriter
This "Confluence" implementation of
XMLEventWriter was introduced primarily to deal with
STAX-58.
The intention is to wrap the default XMLEventWriter and intercept calls to add(javax.xml.stream.events.XMLEvent)
and add(javax.xml.stream.XMLEventReader) and write characters correctly (rather than allowing woodstox to handle it incorrectly).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidadd(XMLEventReader reader) The contract of this method specifies that all it does is loop and delegate toadd(javax.xml.stream.events.XMLEvent).voidclose()voidflush()booleanisHandlingRequired(Characters characters) marshalCharacters(Characters characters) Check for the 3 characters that should be encoded but that aren't by StAX and ensure their encoded form is used in the returned String.voidvoidsetNamespaceContext(NamespaceContext context) void
-
Constructor Details
-
ConfluenceXMLEventWriter
-
-
Method Details
-
add
- Specified by:
addin interfaceXMLEventConsumer- Specified by:
addin interfaceXMLEventWriter- Throws:
XMLStreamException
-
add
The contract of this method specifies that all it does is loop and delegate toadd(javax.xml.stream.events.XMLEvent).In our implementation, we do the same, except we invoke our customized version of
add(javax.xml.stream.events.XMLEvent).- Specified by:
addin interfaceXMLEventWriter- Parameters:
reader-- Throws:
XMLStreamException
-
isHandlingRequired
-
marshalCharacters
Check for the 3 characters that should be encoded but that aren't by StAX and ensure their encoded form is used in the returned String.- Parameters:
characters- the characters to be encoded.- Returns:
- a String with the necessary entities encoded.
-
flush
- Specified by:
flushin interfaceXMLEventWriter- Throws:
XMLStreamException
-
close
- Specified by:
closein interfaceXMLEventWriter- Throws:
XMLStreamException
-
getPrefix
- Specified by:
getPrefixin interfaceXMLEventWriter- Throws:
XMLStreamException
-
setPrefix
- Specified by:
setPrefixin interfaceXMLEventWriter- Throws:
XMLStreamException
-
setDefaultNamespace
- Specified by:
setDefaultNamespacein interfaceXMLEventWriter- Throws:
XMLStreamException
-
setNamespaceContext
- Specified by:
setNamespaceContextin interfaceXMLEventWriter- Throws:
XMLStreamException
-
getNamespaceContext
- Specified by:
getNamespaceContextin interfaceXMLEventWriter
-