| java.lang.Object org.apache.cocoon.components.language.markup.xsp.XSPExpressionParser
All known Subclasses: org.apache.cocoon.components.language.markup.xsp.XSPExpressionFilter,
XSPExpressionParser | public class XSPExpressionParser (Code) | | Parse XSP expressions. Expressions are embedded in attribute="value" and text elements and are
expanded by the
org.apache.cocoon.components.language.markup.xsp.XSPMarkupLanguage.PreProcessFilter PreProcessFilter and have the form {#expression}. To prevent interpolation, use {##quote}, which results in the
text {#quote}.
An exception is thrown if the closing brace is missing.
The parser has a rudimentary understanding of expressions concerning
nested braces and braces inside quoted strings and character constants.
All valid Java, Javascript, and Python expressions can be used.
Example: <h1>Hello {#user.getName()}</h1> <img or
src="image_{#image.getId()}"/>
version: SVN $Id: XSPExpressionParser.java 433543 2006-08-22 06:22:54Z crossley $ |
Inner Class :public static interface Handler | |
Inner Class :abstract protected static class State | |
Inner Class :protected static class QuotedState extends State | |
Field Summary | |
final protected static State | EXPRESSION_CHAR_STATE The parser has encountered '\'' in
EXPRESSION_STATE
to start a character constant. | final protected static State | EXPRESSION_SHELL_STATE The parser has encountered '`' (Backtick, ASCII 0x60) in
EXPRESSION_STATE to start a Python string constant. | final protected static State | EXPRESSION_STATE The parser is parsing an expression. | final protected static State | EXPRESSION_STRING_STATE The parser has encountered '"' in
EXPRESSION_STATE
to start a string constant. | final protected static State | LBRACE_STATE The parser has encountered '{' in
TEXT_STATE . | final protected static State | TEXT_HASH_STATE The parser has encountered '#' in
LBRACE_STATE . | final protected static State | TEXT_STATE The parser is parsing text. |
EXPRESSION_CHAR_STATE | final protected static State EXPRESSION_CHAR_STATE(Code) | | The parser has encountered '\'' in
EXPRESSION_STATE
to start a character constant.
|
EXPRESSION_SHELL_STATE | final protected static State EXPRESSION_SHELL_STATE(Code) | | The parser has encountered '`' (Backtick, ASCII 0x60) in
EXPRESSION_STATE to start a Python string constant.
|
EXPRESSION_STATE | final protected static State EXPRESSION_STATE(Code) | | The parser is parsing an expression.
|
EXPRESSION_STRING_STATE | final protected static State EXPRESSION_STRING_STATE(Code) | | The parser has encountered '"' in
EXPRESSION_STATE
to start a string constant.
|
LBRACE_STATE | final protected static State LBRACE_STATE(Code) | | The parser has encountered '{' in
TEXT_STATE .
|
TEXT_HASH_STATE | final protected static State TEXT_HASH_STATE(Code) | | The parser has encountered '#' in
LBRACE_STATE .
|
TEXT_STATE | final protected static State TEXT_STATE(Code) | | The parser is parsing text.
|
XSPExpressionParser | public XSPExpressionParser(Handler handler)(Code) | | Create a new
XSPExpressionParser .
Parameters: handler - The handler for parsed text and expression fragments. |
append | protected void append(char ch)(Code) | | |
consume | public void consume(String chars) throws SAXException(Code) | | Parses a character sequence.
Parameters: chars - The character sequence to parse throws: SAXException - If there is an error in the sequence. |
consume | public void consume(char[] chars, int start, int length) throws SAXException(Code) | | Parses part of a character array.
Parameters: chars - The characters Parameters: start - The start position in the character array Parameters: length - The number of characters to parse throws: SAXException - If there is an error in the sequence. |
decrNesting | protected int decrNesting()(Code) | | |
flush | public void flush(Locator locator, String description) throws SAXException(Code) | | Flushes the parser
Parameters: locator - The SAX locator to determine the current parse position Parameters: description - The description of the current parse context throws: SAXException - If there is an error in the parsed text.A wrapped LocatedException contains the location of the parse error. |
getState | protected State getState()(Code) | | |
incrNesting | protected void incrNesting()(Code) | | |
initExpression | protected void initExpression()(Code) | | |
isEscaped | protected boolean isEscaped()(Code) | | |
setEscaped | protected void setEscaped(boolean escaped)(Code) | | |
setState | protected void setState(State state)(Code) | | |
|
|