public abstract class Stax2Source extends Object implements 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 String |
mEncoding |
protected String |
mPublicId |
protected String |
mSystemId |
Modifier | Constructor and Description |
---|---|
protected |
Stax2Source() |
Modifier and Type | Method and Description |
---|---|
abstract InputStream |
constructInputStream()
This method creates an
InputStream via which underlying input
source can be accessed. |
abstract Reader |
constructReader()
This method creates a
Reader via which underlying input
source can be accessed. |
String |
getEncoding() |
String |
getPublicId() |
abstract URL |
getReference() |
String |
getSystemId() |
void |
setEncoding(String enc) |
void |
setPublicId(String id) |
void |
setSystemId(String id) |
protected String mSystemId
protected String mPublicId
protected String mEncoding
public String getSystemId()
getSystemId
in interface Source
public void setSystemId(String id)
setSystemId
in interface Source
public String getPublicId()
public void setPublicId(String id)
public String getEncoding()
public void setEncoding(String enc)
public abstract URL getReference()
public abstract Reader constructReader() throws 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.IOException
public abstract InputStream constructInputStream() throws IOException
InputStream
via which underlying input
source can be accessed. Note that caller is responsible for
closing that InputSource when it is done reading itIOException
Copyright © 2015 fasterxml.com. All Rights Reserved.