|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.uima.util.XMLInputSource
public class XMLInputSource
An input source used by the XMLParser
to read XML documents for parsing.
The application uses the XMLInputSource(File)
constructor to create an
XMLInputSource
from a descriptor File
. Alternatively, if the
source of the XML is not a file, the XMLInputSource(InputStream,File)
constructor may be
used to read the XML from an input stream. The second argument to this constructor is the
relative path base, to be used if the descriptor contains imports with relative paths. It is
acceptable to set this to null if it is known that the descriptor does not contain any such
imports.
Constructor Summary | |
---|---|
XMLInputSource(File aFile)
Creates an XMLInputSource from a descriptor file. |
|
XMLInputSource(InputStream aInputStream,
File aRelativePathBase)
Creates an XMLInputSource from an existing InputStream. |
|
XMLInputSource(String aUrlOrFileName)
Creates an XMLInputSource from a descriptor file. |
|
XMLInputSource(URL aURL)
Creates an XMLInputSource from a URL. |
Method Summary | |
---|---|
void |
close()
Closes the underlying InputStream . |
InputStream |
getInputStream()
Gets the InputStream from which to read an XML document. |
File |
getRelativePathBase()
Deprecated. Use getURL() instead. |
URL |
getURL()
Gets the base for resolving relative paths. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLInputSource(File aFile) throws IOException
XMLInputSource
from a descriptor file.
aFile
- file to read from
IOException
- if an I/O error occurspublic XMLInputSource(String aUrlOrFileName) throws IOException
XMLInputSource
from a descriptor file.
aUrlOrFileName
- a URL or a file name to read from
IOException
- if an I/O error occurspublic XMLInputSource(InputStream aInputStream, File aRelativePathBase)
aInputStream
- input stream from which to readaRelativePathBase
- base for resolving relative paths. This must be a directory.public XMLInputSource(URL aURL) throws IOException
XMLInputSource
from a URL.
aURL
- URL to read from
IOException
- if an I/O error occursMethod Detail |
---|
public InputStream getInputStream()
@Deprecated public File getRelativePathBase()
getURL()
instead.
null
if none has been specified.public URL getURL()
null
if none has been specified.public void close() throws IOException
InputStream
.
IOException
- if an I/O error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |