org.enhydra.xml.xmlc.misc
Class SSIReader

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

public final class SSIReader
extends 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.


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, String ssiBase)
          Construct a new reader for the specified file.
 
Method Summary
 void close()
          Close the stream.
static InputSource create(InputSource inputSource, String ssiBase)
          Construct an InputSource containing an SSI reader.
 LineNumberMap getLineNumberMap()
          Get the line number map.
 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,
                 String ssiBase)
          throws IOException
Construct a new reader for the specified file.
Method Detail

getSystemId

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

read

public int read()
         throws IOException
Read a character.
Overrides:
read in class Reader
Returns:
The character, -1 if no more characters are available.

read

public int read(char[] cbuf,
                int off,
                int len)
         throws 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.
Overrides:
read in class Reader
Throws:
IOException - If an I/O error occurs
See Also:
FilterReader.read()

close

public void close()
           throws IOException
Close the stream.
Overrides:
close in class Reader
Throws:
IOException - If an I/O error occurs

getLineNumberMap

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

create

public static InputSource create(InputSource inputSource,
                                 String ssiBase)
                          throws IOException
Construct an InputSource containing an SSI reader.


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.