org.apache.catalina.ssi

Class SSIProcessor


public class SSIProcessor
extends java.lang.Object

The entry point to SSI processing. This class does the actual parsing, delegating to the SSIMediator, SSICommand, and SSIExternalResolver as necessary[

Version:
$Revision: 1.3.2.1 $, $Date: 2004/09/01 16:31:01 $

Author:
Dan Sandberg

Field Summary

protected static int
BUFFER_SIZE
protected static String
COMMAND_END
The end pattern
protected static String
COMMAND_START
The start pattern
protected HashMap
commands
protected int
debug
protected SSIExternalResolver
ssiExternalResolver

Constructor Summary

SSIProcessor(SSIExternalResolver ssiExternalResolver, int debug)

Method Summary

protected void
addBuiltinCommands()
void
addCommand(String name, SSICommand command)
protected boolean
charCmp(String buf, int index, String command)
protected boolean
isSpace(char c)
protected String[]
parseParamNames(StringBuffer cmd, int start)
Parse a StringBuffer and take out the param type token.
protected String[]
parseParamValues(StringBuffer cmd, int start, int count)
Parse a StringBuffer and take out the param token.
void
process(Reader reader, Date lastModifiedDate, PrintWriter writer)
Process a file with server-side commands, reading from reader and writing the processed version to writer.

Field Details

BUFFER_SIZE

protected static final int BUFFER_SIZE

Field Value:
4096


COMMAND_END

protected static final String COMMAND_END
The end pattern


COMMAND_START

protected static final String COMMAND_START
The start pattern


commands

protected HashMap commands


debug

protected int debug


ssiExternalResolver

protected SSIExternalResolver ssiExternalResolver

Constructor Details

SSIProcessor

public SSIProcessor(SSIExternalResolver ssiExternalResolver,
                    int debug)

Method Details

addBuiltinCommands

protected void addBuiltinCommands()


addCommand

public void addCommand(String name,
                       SSICommand command)


charCmp

protected boolean charCmp(String buf,
                          int index,
                          String command)


isSpace

protected boolean isSpace(char c)


parseParamNames

protected String[] parseParamNames(StringBuffer cmd,
                                   int start)
Parse a StringBuffer and take out the param type token. Called from requestHandler

Parameters:
cmd - a value of type 'StringBuffer'

Returns:
a value of type 'String[]'


parseParamValues

protected String[] parseParamValues(StringBuffer cmd,
                                    int start,
                                    int count)
Parse a StringBuffer and take out the param token. Called from requestHandler

Parameters:
cmd - a value of type 'StringBuffer'

Returns:
a value of type 'String[]'


process

public void process(Reader reader,
                    Date lastModifiedDate,
                    PrintWriter writer)
            throws IOException
Process a file with server-side commands, reading from reader and writing the processed version to writer. NOTE: We really should be doing this in a streaming way rather than converting it to an array first.

Parameters:
reader - the reader to read the file containing SSIs from
writer - the writer to write the file with the SSIs processed.


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.