com.icl.saxon
public class ExtendedInputSource extends InputSource
This class allows a SAXON application to encapsulate information about an input source in a single object, which may include a public identifier, a system identifier, a byte stream (possibly with a specified encoding), a character stream, or a file.
Most of the functionality is inherited directly from the SAX InputSource class; the additional functionality offered by ExtendedInputSource is to allow the input source to be specified as a File object.
Constructor and Description |
---|
ExtendedInputSource()
Default constructor
|
ExtendedInputSource(File file)
Create a new input source from a File.
|
ExtendedInputSource(InputSource in)
Create an ExtendedInputSource from an existing InputSource
|
ExtendedInputSource(InputStream stream)
Create a new input source from a byte stream
|
ExtendedInputSource(Reader reader)
Create a new input source from a character stream
|
ExtendedInputSource(String systemId)
Create a new input source from a System ID
|
Modifier and Type | Method and Description |
---|---|
static String |
createURL(File file)
Create a URL that refers to a given File
|
int |
getEstimatedLength()
Get the estimated length of the file (advisory only; -1 if not known)
|
void |
setEstimatedLength(int length)
Set the estimated length of the file (advisory only)
|
void |
setFile(File file)
Specify that input is to come from a given File.
|
getByteStream, getCharacterStream, getEncoding, getPublicId, getSystemId, setByteStream, setCharacterStream, setEncoding, setPublicId, setSystemId
public ExtendedInputSource()
public ExtendedInputSource(String systemId)
public ExtendedInputSource(Reader reader)
public ExtendedInputSource(InputStream stream)
public ExtendedInputSource(File file)
Example of use:
parser.parse(new ExtendedInputSource(new File("test.xml")))
file
- A File object identifying the XML input filepublic ExtendedInputSource(InputSource in)
public void setFile(File file)
public void setEstimatedLength(int length)
public int getEstimatedLength()