Package javanet.staxutils.helpers
Class EventWriterDelegate
- java.lang.Object
-
- javanet.staxutils.helpers.EventWriterDelegate
-
- All Implemented Interfaces:
XMLEventConsumer
,XMLEventWriter
- Direct Known Subclasses:
IndentingXMLEventWriter
public abstract class EventWriterDelegate extends Object implements XMLEventWriter
Abstract class for implementing XML filters. This class provides methods that merely delegate to a contained XMLEventWriter. Subclasses should override some of these methods, and may also provide additional methods and fields.- Author:
- John Kristian
-
-
Field Summary
Fields Modifier and Type Field Description protected XMLEventWriter
out
The downstream writer, to which events are delegated.
-
Constructor Summary
Constructors Modifier Constructor Description protected
EventWriterDelegate(XMLEventWriter out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(XMLEvent event)
void
add(XMLEventReader reader)
Add events from the given reader, one by one.void
close()
void
flush()
NamespaceContext
getNamespaceContext()
String
getPrefix(String uri)
void
setDefaultNamespace(String uri)
void
setNamespaceContext(NamespaceContext context)
void
setPrefix(String prefix, String uri)
-
-
-
Field Detail
-
out
protected final XMLEventWriter out
The downstream writer, to which events are delegated.
-
-
Constructor Detail
-
EventWriterDelegate
protected EventWriterDelegate(XMLEventWriter out)
-
-
Method Detail
-
setNamespaceContext
public void setNamespaceContext(NamespaceContext context) throws XMLStreamException
- Specified by:
setNamespaceContext
in interfaceXMLEventWriter
- Throws:
XMLStreamException
-
getNamespaceContext
public NamespaceContext getNamespaceContext()
- Specified by:
getNamespaceContext
in interfaceXMLEventWriter
-
setDefaultNamespace
public void setDefaultNamespace(String uri) throws XMLStreamException
- Specified by:
setDefaultNamespace
in interfaceXMLEventWriter
- Throws:
XMLStreamException
-
setPrefix
public void setPrefix(String prefix, String uri) throws XMLStreamException
- Specified by:
setPrefix
in interfaceXMLEventWriter
- Throws:
XMLStreamException
-
getPrefix
public String getPrefix(String uri) throws XMLStreamException
- Specified by:
getPrefix
in interfaceXMLEventWriter
- Throws:
XMLStreamException
-
add
public void add(XMLEvent event) throws XMLStreamException
- Specified by:
add
in interfaceXMLEventConsumer
- Specified by:
add
in interfaceXMLEventWriter
- Throws:
XMLStreamException
-
add
public void add(XMLEventReader reader) throws XMLStreamException
Add events from the given reader, one by one.- Specified by:
add
in interfaceXMLEventWriter
- Throws:
XMLStreamException
-
flush
public void flush() throws XMLStreamException
- Specified by:
flush
in interfaceXMLEventWriter
- Throws:
XMLStreamException
-
close
public void close() throws XMLStreamException
- Specified by:
close
in interfaceXMLEventWriter
- Throws:
XMLStreamException
-
-