Package org.codehaus.stax2.io
Class Stax2ReferentialSource
- java.lang.Object
-
- org.codehaus.stax2.io.Stax2Source
-
- org.codehaus.stax2.io.Stax2ReferentialSource
-
- All Implemented Interfaces:
Source
- Direct Known Subclasses:
Stax2FileSource
,Stax2URLSource
public abstract class Stax2ReferentialSource extends Stax2Source
This is the mid-level abstract base class forStax2Source
s that refer to a resource in such a way, that an efficientInputStream
orReader
can be constructed. Additionally, referenced sources also provide the base URI that allows for resolving relative references from within content read from such resources. Typical examples of references areURL
andFile
: both for which a default implementations exist in this package- See Also:
Stax2FileSource
,Stax2URLSource
-
-
Field Summary
-
Fields inherited from class org.codehaus.stax2.io.Stax2Source
mEncoding, mPublicId, mSystemId
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Stax2ReferentialSource()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract InputStream
constructInputStream()
This method creates anInputStream
via which underlying input source can be accessed.abstract Reader
constructReader()
This method creates aReader
via which underlying input source can be accessed.abstract URL
getReference()
String
getSystemId()
Since we can determine a system id from the base URL-
Methods inherited from class org.codehaus.stax2.io.Stax2Source
getEncoding, getPublicId, setEncoding, setPublicId, setSystemId
-
-
-
-
Method Detail
-
getReference
public abstract URL getReference()
- Specified by:
getReference
in classStax2Source
- Returns:
- URL that can be used to resolve references originating from the content read via this source; may be null if not known (which is the case for most non-referential sources)
-
constructReader
public abstract Reader constructReader() throws IOException
Description copied from class:Stax2Source
This method creates aReader
via which underlying input source can be accessed. Note that caller is responsible for closing that Reader when it is done reading it.- Specified by:
constructReader
in classStax2Source
- Throws:
IOException
-
constructInputStream
public abstract InputStream constructInputStream() throws IOException
Description copied from class:Stax2Source
This method creates anInputStream
via which underlying input source can be accessed. Note that caller is responsible for closing that InputSource when it is done reading it- Specified by:
constructInputStream
in classStax2Source
- Throws:
IOException
-
getSystemId
public String getSystemId()
Since we can determine a system id from the base URL- Specified by:
getSystemId
in interfaceSource
- Overrides:
getSystemId
in classStax2Source
-
-