javax.xml.transform.stream
public class StreamSource extends Object implements Source
Field Summary | |
---|---|
static String | FEATURE If {@link javax.xml.transform.TransformerFactory#getFeature}
returns true when passed this value as an argument,
the Transformer supports Source input of this type. |
Constructor Summary | |
---|---|
StreamSource()
Zero-argument default constructor. | |
StreamSource(InputStream inputStream)
Construct a StreamSource from a byte stream. | |
StreamSource(InputStream inputStream, String systemId)
Construct a StreamSource from a byte stream. | |
StreamSource(Reader reader)
Construct a StreamSource from a character reader. | |
StreamSource(Reader reader, String systemId)
Construct a StreamSource from a character reader. | |
StreamSource(String systemId)
Construct a StreamSource from a URL.
| |
StreamSource(File f)
Construct a StreamSource from a File.
|
Method Summary | |
---|---|
InputStream | getInputStream()
Get the byte stream that was set with setByteStream.
|
String | getPublicId()
Get the public identifier that was set with setPublicId.
|
Reader | getReader()
Get the character stream that was set with setReader.
|
String | getSystemId()
Get the system identifier that was set with setSystemId.
|
void | setInputStream(InputStream inputStream)
Set the byte stream to be used as input. |
void | setPublicId(String publicId)
Set the public identifier for this Source.
|
void | setReader(Reader reader)
Set the input to be a character reader. |
void | setSystemId(String systemId)
Set the system identifier for this Source.
|
void | setSystemId(File f)
Set the system ID from a File reference.
|
If this constructor is used to process a stylesheet, normally setSystemId should also be called, so that relative URI references can be resolved.
Parameters: inputStream A valid InputStream reference to an XML stream.
This constructor allows the systemID to be set in addition to the input stream, which allows relative URIs to be processed.
Parameters: inputStream A valid InputStream reference to an XML stream. systemId Must be a String that conforms to the URI syntax.
Parameters: reader A valid Reader reference to an XML character stream.
Parameters: reader A valid Reader reference to an XML character stream. systemId Must be a String that conforms to the URI syntax.
Parameters: systemId Must be a String that conforms to the URI syntax.
Parameters: f Must a non-null File reference.
Returns: The byte stream that was set with setByteStream, or null if setByteStream or the ByteStream constructor was not called.
Returns: The public identifier that was set with setPublicId, or null if setPublicId was not called.
Returns: The character stream that was set with setReader, or null if setReader or the Reader constructor was not called.
Returns: The system identifier that was set with setSystemId, or null if setSystemId was not called.
If this Source object is used to process a stylesheet, normally setSystemId should also be called, so that relative URL references can be resolved.
Parameters: inputStream A valid InputStream reference to an XML stream.
The public identifier is always optional: if the application writer includes one, it will be provided as part of the location information.
Parameters: publicId The public identifier as a string.
Parameters: reader A valid Reader reference to an XML CharacterStream.
The system identifier is optional if there is a byte stream or a character stream, but it is still useful to provide one, since the application can use it to resolve relative URIs and can include it in error messages and warnings (the parser will attempt to open a connection to the URI only if there is no byte stream or character stream specified).
Parameters: systemId The system identifier as a URL string.
Parameters: f Must a non-null File reference.