This is the base class for additional output results (implementations
of
javax.xml.transform.Result) that Stax2
org.codehaus.stax2.XMLInputFactory2 implementations should support.
Note about usage by the parser factory implementations: the expectation
is that at least one of methods
#constructWriter and
#constructOutputStream will succeed, but not necessarily both.
This generally depends on type of resource being represented: for example,
if the source is a StringBuffer, it is most naturally
represent via
Writer. For File-backed results, on the other hand,
an
OutputStream is the most natural access method.
Other things to note about using result
Writers and
OutputStreams:
- Caller is responsible for closing any
Writer and
OutputStream instances requested. That is, caller owns
these accessor objects.
- Result objects are only required to return a non-null object
once: after this, if new non-null instances are returned,
they must not be the same objects as returned earlier.
Implementations can choose to construct new instances to the same
backing data structure or resource; if so, they should document
this behavior.