Source implementation backed by DataHandler.
This implementation allows the same Source to be used
mutliple times.
Source isn't really pluggable. As a consequence,
this implementation is clunky --- weak against unexpected
usage of the class.
| Modifier and Type | Field and Description |
|---|---|
| private final String | charset
If null, default to the encoding declaration |
| private InputStream | |
| private Reader | |
| private final DataSource |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public DataSource | |
| public InputStream | getInputStream()
Overrides javax. Get the byte stream that was set with setByteStream. |
| public Reader | getReader()
Overrides javax. Get the character stream that was set with setReader. |
| public void | setInputStream(InputStream inputStream)
Overrides javax. Set the byte stream to be used as input. |
| public void | setReader(Reader reader)
Overrides javax. Set the input to be a character reader. |
| charset | back to summary |
|---|---|
| private final String charset If null, default to the encoding declaration | |
| is | back to summary |
|---|---|
| private InputStream is | |
| r | back to summary |
|---|---|
| private Reader r | |
| source | back to summary |
|---|---|
| private final DataSource source | |
| DataSourceSource | back to summary |
|---|---|
| public DataSourceSource(DataHandler dh) throws MimeTypeParseException | |
| DataSourceSource | back to summary |
|---|---|
| public DataSourceSource(DataSource source) throws MimeTypeParseException | |
| getDataSource | back to summary |
|---|---|
| public DataSource getDataSource() | |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() Overrides javax. Doc from javax. Get the byte stream that was set with setByteStream.
| |
| getReader | back to summary |
|---|---|
| public Reader getReader() Overrides javax. Doc from javax. Get the character stream that was set with setReader.
| |
| setInputStream | back to summary |
|---|---|
| public void setInputStream(InputStream inputStream) Overrides javax. Doc from javax. Set the byte stream to be used as input. Normally, a stream should be used rather than a reader, so that the XML parser can resolve character encoding specified by the XML declaration. If this Source object is used to process a stylesheet, normally setSystemId should also be called, so that relative URL references can be resolved.
| |
| setReader | back to summary |
|---|---|
| public void setReader(Reader reader) Overrides javax. Doc from javax. Set the input to be a character reader. Normally, a stream should be used rather than a reader, so that the XML parser can resolve character encoding specified by the XML declaration. However, in many cases the encoding of the input stream is already resolved, as in the case of reading XML from a StringReader.
| |