Package org.dellroad.stuff.xml
Class StreamWriterAction
java.lang.Object
org.dellroad.stuff.xml.StreamWriterAction
Represents some XML output event(s) that can be applied to an
XMLStreamWriter
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
apply
(XMLStreamWriter writer) Apply this action to the givenXMLStreamWriter
by invoking method(s) to effect some XML output event(s).static StreamWriterAction
of
(XMLStreamReader reader) Get an instance that corresponds to the current event state of the givenXMLStreamReader
, such that a sequence of such instances created from consecutive input events will recreate the input XML.
-
Constructor Details
-
StreamWriterAction
protected StreamWriterAction()
-
-
Method Details
-
apply
Apply this action to the givenXMLStreamWriter
by invoking method(s) to effect some XML output event(s).- Parameters:
writer
- XML writer- Throws:
XMLStreamException
- if an XML error occursNullPointerException
- ifwriter
is null
-
of
Get an instance that corresponds to the current event state of the givenXMLStreamReader
, such that a sequence of such instances created from consecutive input events will recreate the input XML.This method does not advance or modify
reader
.- Parameters:
reader
- XML input- Returns:
- action corresponding to
reader
- Throws:
XMLStreamException
- if an error occursNullPointerException
- ifreader
is null
-