java.lang.Object
com.sun.xml.fastinfoset.stax.events.StAXEventWriter
- All Implemented Interfaces:
XMLEventConsumer
,XMLEventWriter
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an event to the output stream Adding a START_ELEMENT will open a new namespace scope that will be closed when the corresponding END_ELEMENT is written.void
add
(XMLEventReader eventReader) void
close()
Frees any resources associated with this streamvoid
flush()
Writes any cached events to the underlying output mechanismReturns the current namespace context.Gets the prefix the uri is bound tovoid
Binds a URI to the default namespace This URI is bound in the scope of the current START_ELEMENT / END_ELEMENT pair.void
setNamespaceContext
(NamespaceContext namespaceContext) Sets the current namespace context for prefix and uri bindings.void
Sets the prefix the uri is bound to.
-
Field Details
-
_streamWriter
-
-
Constructor Details
-
StAXEventWriter
-
-
Method Details
-
flush
Writes any cached events to the underlying output mechanism- Specified by:
flush
in interfaceXMLEventWriter
- Throws:
XMLStreamException
-
close
Frees any resources associated with this stream- Specified by:
close
in interfaceXMLEventWriter
- Throws:
XMLStreamException
-
add
- Specified by:
add
in interfaceXMLEventWriter
- Throws:
XMLStreamException
-
add
Add an event to the output stream Adding a START_ELEMENT will open a new namespace scope that will be closed when the corresponding END_ELEMENT is written.- Specified by:
add
in interfaceXMLEventConsumer
- Specified by:
add
in interfaceXMLEventWriter
- Throws:
XMLStreamException
-
getPrefix
Gets the prefix the uri is bound to- Specified by:
getPrefix
in interfaceXMLEventWriter
- Parameters:
uri
- the uri to look up- Throws:
XMLStreamException
-
getNamespaceContext
Returns the current namespace context.- Specified by:
getNamespaceContext
in interfaceXMLEventWriter
- Returns:
- the current namespace context
-
setDefaultNamespace
Binds a URI to the default namespace This URI is bound in the scope of the current START_ELEMENT / END_ELEMENT pair. If this method is called before a START_ELEMENT has been written the uri is bound in the root scope.- Specified by:
setDefaultNamespace
in interfaceXMLEventWriter
- Parameters:
uri
- the uri to bind to the default namespace- Throws:
XMLStreamException
-
setNamespaceContext
Sets the current namespace context for prefix and uri bindings. This context becomes the root namespace context for writing and will replace the current root namespace context. Subsequent calls to setPrefix and setDefaultNamespace will bind namespaces using the context passed to the method as the root context for resolving namespaces.- Specified by:
setNamespaceContext
in interfaceXMLEventWriter
- Parameters:
namespaceContext
- the namespace context to use for this writer- Throws:
XMLStreamException
-
setPrefix
Sets the prefix the uri is bound to. This prefix is bound in the scope of the current START_ELEMENT / END_ELEMENT pair. If this method is called before a START_ELEMENT has been written the prefix is bound in the root scope.- Specified by:
setPrefix
in interfaceXMLEventWriter
- Parameters:
prefix
- the prefix to bind to the uriuri
- the uri to bind to the prefix- Throws:
XMLStreamException
-