| Modifier and Type | Class and Description |
|---|---|
| private static record | TemplateAwareExpressionParser.Bracket
This captures a type of bracket and the position in which it occurs in the expression. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract Expression | Returns: an evaluator for the parsed expressionthe raw expression string to parse expressionString, ParserContext a context for influencing this expression parsing routine (optional) context)Actually parse the expression string and return an Expression object. |
| private boolean | isSuffixHere(String
the expression string which may contain the suffix expressionString, int the start position at which to check for the suffix pos, String the suffix string suffix)Return true if the specified suffix can be found at the supplied position in the supplied expression string. |
| public Expression | parseExpression(String
the raw expression string to parse expressionString)Implements org. |
| public Expression | parseExpression(String
the raw expression string to parse expressionString, ParserContext a context for influencing this expression parsing routine (optional) context)Implements org. |
| private Expression[] | Returns: the parsed expressionsthe expression string expressionString, ParserContext context)Helper that parses given expression string using the configured parser. |
| private Expression | |
| private int | Returns: the position of the correct matching nextSuffix or -1 if none can be foundthe suffix suffix, String the expression string expressionString, int the most recently found prefix location for which the
matching end suffix is being sought afterPrefixIndex)Copes with nesting, for example '${...${...}}' where the correct end for the first ${ is the final }. |
| TemplateAwareExpressionParser | back to summary |
|---|---|
| public TemplateAwareExpressionParser() | |
| doParseExpression | back to summary |
|---|---|
| protected abstract Expression doParseExpression(String expressionString, ParserContext context) throws ParseException Actually parse the expression string and return an Expression object.
| |
| isSuffixHere | back to summary |
|---|---|
| private boolean isSuffixHere(String expressionString, int pos, String suffix) Return true if the specified suffix can be found at the supplied position in the supplied expression string. | |
| parseExpression | back to summary |
|---|---|
| public Expression parseExpression(String expressionString) throws ParseException Implements org. Doc from org. Parse the expression string and return an Expression object you can use for repeated evaluation. Some examples:
3 + 4
name.firstName
| |
| parseExpression | back to summary |
|---|---|
| public Expression parseExpression(String expressionString, ParserContext context) throws ParseException Implements org. Doc from org. Parse the expression string and return an Expression object you can use for repeated evaluation. Some examples:
3 + 4
name.firstName
| |
| parseExpressions | back to summary |
|---|---|
| private Expression[] parseExpressions(String expressionString, ParserContext context) throws ParseException Helper that parses given expression string using the configured parser. The expression string can contain any number of expressions all contained in "${...}" markers. For instance: "foo${expr0}bar${expr1}". The static pieces of text will also be returned as Expressions that just return that static piece of text. As a result, evaluating all returned expressions and concatenating the results produces the complete evaluated string. Unwrapping is only done of the outermost delimiters found, so the string 'hello ${foo${abc}}' would break into the pieces 'hello ' and 'foo${abc}'. This means that expression languages that use ${..} as part of their functionality are supported without any problem. The parsing is aware of the structure of an embedded expression. It assumes that parentheses '(', square brackets '[', and curly brackets '}' must be in pairs within the expression unless they are within a string literal and the string literal starts and terminates with a single quote '.
| |
| parseTemplate | back to summary |
|---|---|
| private Expression parseTemplate(String expressionString, ParserContext context) throws ParseException | |
| skipToCorrectEndSuffix | back to summary |
|---|---|
| private int skipToCorrectEndSuffix(String suffix, String expressionString, int afterPrefixIndex) throws ParseException Copes with nesting, for example '${...${...}}' where the correct end for the first ${ is the final }. | |
| Modifier and Type | Field and Description |
|---|---|
| private final char | |
| private final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public char | |
| pack-priv boolean | |
| public final boolean | equals(Object
the reference object with which to compare. o)Implements abstract java. |
| public final int | |
| public int | |
| pack-priv static char | |
| pack-priv static char | |
| public final String | toString()
Implements abstract java. |
| bracket | back to summary |
|---|---|
| private final char bracket Record Component accessed by bracket(). | |
| pos | back to summary |
|---|---|
| private final int pos Record Component accessed by pos(). | |
| Bracket | back to summary |
|---|---|
| private Bracket(char bracket, int pos) | |
| bracket | back to summary |
|---|---|
| public char bracket() Record Component getter of bracket. | |
| compatibleWithCloseBracket | back to summary |
|---|---|
| pack-priv boolean compatibleWithCloseBracket(char closeBracket) | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of
| |
| pos | back to summary |
|---|---|
| public int pos() Record Component getter of pos. | |
| theCloseBracketFor | back to summary |
|---|---|
| pack-priv static char theCloseBracketFor(char openBracket) | |
| theOpenBracketFor | back to summary |
|---|---|
| pack-priv static char theOpenBracketFor(char closeBracket) | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.
| |