| 537 | |
| 538 | |
| 539 | static class TextBuilder extends ELNode.Visitor { |
| 540 | |
| 541 | protected final boolean isDeferredSyntaxAllowedAsLiteral; |
| 542 | protected final StringBuilder output = new StringBuilder(); |
| 543 | |
| 544 | protected TextBuilder(boolean isDeferredSyntaxAllowedAsLiteral) { |
| 545 | this.isDeferredSyntaxAllowedAsLiteral = isDeferredSyntaxAllowedAsLiteral; |
| 546 | } |
| 547 | |
| 548 | public String getText() { |
| 549 | return output.toString(); |
| 550 | } |
| 551 | |
| 552 | @Override |
| 553 | public void visit(Root n) throws JasperException { |
| 554 | output.append(n.getType()); |
| 555 | output.append('{'); |
| 556 | n.getExpression().visit(this); |
| 557 | output.append('}'); |
| 558 | } |
| 559 | |
| 560 | @Override |
| 561 | public void visit(Function n) throws JasperException { |
| 562 | output.append(escapeLiteralExpression(n.getOriginalText(), isDeferredSyntaxAllowedAsLiteral)); |
| 563 | output.append('('); |
| 564 | } |
| 565 | |
| 566 | @Override |
| 567 | public void visit(Text n) throws JasperException { |
| 568 | output.append(escapeLiteralExpression(n.getText(), isDeferredSyntaxAllowedAsLiteral)); |
| 569 | } |
| 570 | |
| 571 | @Override |
| 572 | public void visit(ELText n) throws JasperException { |
| 573 | output.append(escapeELText(n.getText())); |
| 574 | } |
| 575 | } |
| 576 | } |
nothing calls this directly
no outgoing calls
no test coverage detected