|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.Reader | +--org.enhydra.xml.xmlc.misc.SSIReader
A reader that implements Server-Side Includes (SSI). This used the syntax defined by Apache mod_include, however it only implements the `include' directive.
This input stream automatically closes on reaching EOF.
Inner Class Summary | |
class |
SSIReader.Listener
Listener for SSI open/close events. |
Fields inherited from class java.io.Reader |
lock |
Constructor Summary | |
SSIReader(InputSource source)
Same as SSIReader(source, null, null) |
|
SSIReader(InputSource source,
String ssiBase)
Same as SSIReader(source, ssiBase, null) |
|
SSIReader(InputSource source,
String ssiBase,
SSISystemIdResolver ssiSystemIdResolver)
|
Method Summary | |
void |
close()
Close the stream. |
static InputSource |
create(InputSource source)
Same as create(source, null, null) |
static InputSource |
create(InputSource source,
String ssiBase)
Same as create(source, ssiBase, null) |
static InputSource |
create(InputSource source,
String ssiBase,
SSISystemIdResolver ssiSystemIdResolver)
Construct an InputSource containing an SSI Reader. |
LineNumberMap |
getLineNumberMap()
Get the line number map. |
String |
getSystemId()
|
int |
read()
Read a character. |
int |
read(char[] cbuf,
int off,
int len)
Read characters into a portion of an array. |
Methods inherited from class java.io.Reader |
mark, markSupported, read, ready, reset, skip |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public SSIReader(InputSource source) throws IOException
SSIReader(source, null, null)
source
- the InputSource representing the including file, required,
must not be nullIOException
- if unable to load including file and/or SSIsNullPointerException
- if source is nullpublic SSIReader(InputSource source, String ssiBase) throws IOException
SSIReader(source, ssiBase, null)
source
- the InputSource representing the including file, required,
must not be nullssiBase
- a path for which a root-relative ssiPath is to be resolved
against, optional, may be nullIOException
- if unable to load including file and/or SSIsNullPointerException
- if source is nullpublic SSIReader(InputSource source, String ssiBase, SSISystemIdResolver ssiSystemIdResolver) throws IOException
source
- the InputSource representing the including file, required,
must not be nullssiBase
- a path for which a root-relative ssiPath is to be resolved
against, optional, may be nullssiSystemIdResolver
- a system Id resolver with which to resolve SSIs,
optional, if null one will be internally createdIOException
- if unable to load including file and/or SSIsNullPointerException
- if source is nullMethod Detail |
public String getSystemId()
public int read() throws IOException
read
in class Reader
public int read(char[] cbuf, int off, int len) throws IOException
read
in class Reader
throws IOException if an I/O error occurs
public void close() throws IOException
close
in class Reader
IOException
- If an I/O error occurspublic final LineNumberMap getLineNumberMap()
public static InputSource create(InputSource source) throws IOException
create(source, null, null)
source
- the InputSource representing the including file, required,
must not be nullIOException
- if unable to load including file and/or SSIsNullPointerException
- if source is nullpublic static InputSource create(InputSource source, String ssiBase) throws IOException
create(source, ssiBase, null)
source
- the InputSource representing the including file, required,
must not be nullssiBase
- a path for which a root-relative ssiPath is to be resolved
against, optional, may be nullIOException
- if unable to load including file and/or SSIsNullPointerException
- if source is nullpublic static InputSource create(InputSource source, String ssiBase, SSISystemIdResolver ssiSystemIdResolver) throws IOException
Note: does not wrap SSI Reader in ClosingInputSource, as is common in other cases to guarantee that no file handles will be left open (on Windows). The reason is so consumers can access the unwrapped reader in order to obtain the LineNumberMap. Fortunately, experimentation shows that wrapping in this case is unnecessary; not even by downstream consumers.
source
- the InputSource representing the including file, required,
must not be nullssiBase
- a path for which a root-relative ssiPath is to be resolved
against, optional, may be nullssiSystemIdResolver
- a system Id resolver with which to resolve SSIs,
optional, if null one will be internally createdIOException
- if unable to load including file and/or SSIsNullPointerException
- if source is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |