Package org.apache.catalina.ssi
Class SSIProcessor
java.lang.Object
org.apache.catalina.ssi.SSIProcessor
The entry point to SSI processing. This class does the actual parsing, delegating to the SSIMediator, SSICommand, and
 SSIExternalResolver as necessary.
- Author:
- Dan Sandberg, David Becker
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final booleanprotected static final StringThe end patternprotected static final StringThe start patternprotected final HashMap<String,SSICommand> protected final intprotected final SSIExternalResolver
- 
Constructor SummaryConstructorsConstructorDescriptionSSIProcessor(SSIExternalResolver ssiExternalResolver, int debug, boolean allowExec) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidvoidaddCommand(String name, SSICommand command) protected booleanprotected booleanisQuote(char c) protected booleanisSpace(char c) protected String[]parseParamNames(StringBuilder cmd, int start) Parse a StringBuilder and take out the param type token.protected String[]parseParamValues(StringBuilder cmd, int start, int count) Parse a StringBuilder and take out the param token.longprocess(Reader reader, long lastModifiedDate, PrintWriter writer) Process a file with server-side commands, reading from reader and writing the processed version to writer.
- 
Field Details- 
COMMAND_STARTThe start pattern- See Also:
 
- 
COMMAND_ENDThe end pattern- See Also:
 
- 
ssiExternalResolver
- 
commands
- 
debugprotected final int debug
- 
allowExecprotected final boolean allowExec
 
- 
- 
Constructor Details- 
SSIProcessor
 
- 
- 
Method Details- 
addBuiltinCommandsprotected void addBuiltinCommands()
- 
addCommand
- 
processProcess 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
- lastModifiedDate- resource last modification date
- writer- the writer to write the file with the SSIs processed.
- Returns:
- the most current modified date resulting from any SSI commands
- Throws:
- IOException- when things go horribly awry. Should be unlikely since the SSICommand usually catches 'normal' IOExceptions.
 
- 
parseParamNamesParse a StringBuilder and take out the param type token. Called fromrequestHandler- Parameters:
- cmd- a value of type 'StringBuilder'
- start- index on which parsing will start
- Returns:
- an array with the parameter names
 
- 
parseParamValuesParse a StringBuilder and take out the param token. Called fromrequestHandler- Parameters:
- cmd- a value of type 'StringBuilder'
- start- index on which parsing will start
- count- number of values which should be parsed
- Returns:
- an array with the parameter values
 
- 
charCmp
- 
isSpaceprotected boolean isSpace(char c) 
- 
isQuoteprotected boolean isQuote(char c) 
 
-