org.codehaus.stax2.io
public abstract class Stax2Source extends java.lang.Object implements javax.xml.transform.Source
Source
) that Stax2
XMLInputFactory2
implementations should support.
Note about usage by the parser factory implementations: the expectation
is that at least one of methods constructReader()
and
constructInputStream()
will succeed, but not necessarily both.
This generally depends on type of resource being represented: for example,
if the source is a String or character array, it is most naturally
represent via Reader
. For a byte array, on the other hand,
an InputStream
is the most natural access method.
Other things to note about using result Reader
s and
InputStream
s:
Reader
and
InputStream
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 |
Stax2Source() |
Modifier and Type | Method and Description |
---|---|
abstract java.io.InputStream |
constructInputStream()
This method creates an
InputStream via which underlying input
source can be accessed. |
abstract java.io.Reader |
constructReader()
This method creates a
Reader via which underlying input
source can be accessed. |
java.lang.String |
getEncoding() |
java.lang.String |
getPublicId() |
abstract java.net.URL |
getReference() |
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.Source
public void setSystemId(java.lang.String id)
setSystemId
in interface javax.xml.transform.Source
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.net.URL getReference()
public abstract java.io.Reader constructReader() throws java.io.IOException
Reader
via which underlying input
source can be accessed. Note that caller is responsible for
closing that Reader when it is done reading it.java.io.IOException
public abstract java.io.InputStream constructInputStream() throws java.io.IOException
InputStream
via which underlying input
source can be accessed. Note that caller is responsible for
closing that InputSource when it is done reading itjava.io.IOException