Parse a template fragment. @param fragment to parse
(String fragment)
| 212 | * @param fragment to parse |
| 213 | */ |
| 214 | private void parseFragment(String fragment) { |
| 215 | ChunkTokenizer tokenizer = new ChunkTokenizer(fragment); |
| 216 | |
| 217 | while (tokenizer.hasNext()) { |
| 218 | /* check to see if we have an expression or a literal */ |
| 219 | String chunk = tokenizer.next(); |
| 220 | |
| 221 | if (chunk.startsWith("{")) { |
| 222 | Expression expression = Expressions.create(chunk); |
| 223 | if (expression == null) { |
| 224 | this.templateChunks.add(Literal.create(this.encodeLiteral(chunk))); |
| 225 | } else { |
| 226 | this.templateChunks.add(expression); |
| 227 | } |
| 228 | } else { |
| 229 | this.templateChunks.add(Literal.create(this.encodeLiteral(chunk))); |
| 230 | } |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | @Override |
| 235 | public String toString() { |
no test coverage detected