Enhydra 5.1 API

org.enhydra.xml.xmlc.misc
Class SSIReader

java.lang.Object
  |
  +--java.io.Reader
        |
        +--org.enhydra.xml.xmlc.misc.SSIReader

public final class SSIReader
extends java.io.Reader

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.


Nested Class Summary
 class SSIReader.Listener
          Listener for SSI open/close events.
 
Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
SSIReader(InputSource source)
          Construct a new reader for the specified file.
 
Method Summary
 void close()
          Close the stream.
static InputSource create(InputSource inputSource)
          Construct an InputSource containing an SSI reader.
 LineNumberMap getLineNumberMap()
          Get the line number map.
 java.lang.String getSystemId()
          Get the system id of the currently opened file.
 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SSIReader

public SSIReader(InputSource source)
          throws java.io.IOException
Construct a new reader for the specified file.

Method Detail

getSystemId

public java.lang.String getSystemId()
Get the system id of the currently opened file.


read

public int read()
         throws java.io.IOException
Read a character.

Overrides:
read in class java.io.Reader
Returns:
The character, -1 if no more characters are available.
java.io.IOException

read

public int read(char[] cbuf,
                int off,
                int len)
         throws java.io.IOException
Read characters into a portion of an array. To simplify the handling of an SSI directive, a directive is only processed if it's at the start of the buffer. SSIs in the middle of the read result in a partial read.

Specified by:
read in class java.io.Reader
Throws:
java.io.IOException - If an I/O error occurs
See Also:
FilterReader#read

close

public void close()
           throws java.io.IOException
Close the stream.

Specified by:
close in class java.io.Reader
Throws:
java.io.IOException - If an I/O error occurs

getLineNumberMap

public final LineNumberMap getLineNumberMap()
Get the line number map.


create

public static InputSource create(InputSource inputSource)
                          throws java.io.IOException
Construct an InputSource containing an SSI reader.

java.io.IOException

Enhydra 5.1 API