Parse an EL expression string '${...}'. Currently only separates the EL into functions and everything else. @return An ELNode.Nodes representing the EL expression Note: This cannot be refactored to use the standard EL implementation as the EL API does not provide the level of access req
()
| 90 | * implementation as the EL API does not provide the level of access required to the parsed expression. |
| 91 | */ |
| 92 | private ELNode.Nodes parseEL() { |
| 93 | |
| 94 | StringBuilder buf = new StringBuilder(); |
| 95 | ELexpr = new ELNode.Nodes(); |
| 96 | curToken = null; |
| 97 | prevToken = null; |
| 98 | int openBraces = 0; |
| 99 | while (hasNext()) { |
| 100 | curToken = nextToken(); |
| 101 | if (curToken instanceof Char) { |
| 102 | if (curToken.toChar() == '}') { |
| 103 | openBraces--; |
| 104 | if (openBraces < 0) { |
| 105 | break; |
| 106 | } |
| 107 | } else if (curToken.toChar() == '{') { |
| 108 | openBraces++; |
| 109 | } |
| 110 | buf.append(curToken.toString()); |
| 111 | } else { |
| 112 | // Output whatever is in buffer |
| 113 | if (!buf.isEmpty()) { |
| 114 | ELexpr.add(new ELNode.ELText(buf.toString())); |
| 115 | buf.setLength(0); |
| 116 | } |
| 117 | if (!parseFunction()) { |
| 118 | ELexpr.add(new ELNode.ELText(curToken.toString())); |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | if (curToken != null) { |
| 123 | buf.append(curToken.getWhiteSpace()); |
| 124 | } |
| 125 | if (!buf.isEmpty()) { |
| 126 | ELexpr.add(new ELNode.ELText(buf.toString())); |
| 127 | } |
| 128 | |
| 129 | return ELexpr; |
| 130 | } |
| 131 | |
| 132 | /** |
| 133 | * Parse for a function FunctionInvocation ::= (identifier ':')? identifier '(' (Expression (,Expression)*)? ')' |