public abstract class Stax2Result
extends java.lang.Object
implements javax.xml.transform.Result
Result
) that 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 Writer
s and
OutputStream
s:
Writer
and
OutputStream
instances requested. That is, caller owns
these accessor objects.
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
mEncoding |
protected java.lang.String |
mPublicId |
protected java.lang.String |
mSystemId |
Modifier | Constructor and Description |
---|---|
protected |
Stax2Result() |
Modifier and Type | Method and Description |
---|---|
abstract java.io.OutputStream |
constructOutputStream()
This method creates an
OutputStream via which underlying output
target can be written to. |
abstract java.io.Writer |
constructWriter()
This method creates a
Writer via which underlying output
target can be written to. |
java.lang.String |
getEncoding() |
java.lang.String |
getPublicId() |
java.lang.String |
getSystemId() |
void |
setEncoding(java.lang.String enc) |
void |
setPublicId(java.lang.String id) |
void |
setSystemId(java.lang.String id) |
protected java.lang.String mSystemId
protected java.lang.String mPublicId
protected java.lang.String mEncoding
public java.lang.String getSystemId()
getSystemId
in interface javax.xml.transform.Result
public void setSystemId(java.lang.String id)
setSystemId
in interface javax.xml.transform.Result
public java.lang.String getPublicId()
public void setPublicId(java.lang.String id)
public java.lang.String getEncoding()
public void setEncoding(java.lang.String enc)
public abstract java.io.Writer constructWriter() throws java.io.IOException
Writer
via which underlying output
target can be written to. Note that caller is responsible for
closing that Writer when it is done reading it.java.io.IOException
public abstract java.io.OutputStream constructOutputStream() throws java.io.IOException
OutputStream
via which underlying output
target can be written to. Note that caller is responsible for
closing that OutputStream when it is done reading itjava.io.IOException