Write out an expression result that uses expression options. E.g.,
(STWriter out, InstanceScope scope, Object o, Object[] options)
| 636 | */ |
| 637 | |
| 638 | protected int writeObjectWithOptions(STWriter out, InstanceScope scope, Object o, Object[] options) { |
| 639 | int start = out.index(); // track char we're about to write |
| 640 | // precompute all option values (render all the way to strings) |
| 641 | String[] optionStrings = null; |
| 642 | if ( options!=null ) { |
| 643 | optionStrings = new String[options.length]; |
| 644 | for (int i = 0; i < Compiler.NUM_OPTIONS; i++) { |
| 645 | optionStrings[i] = toString(out, scope, options[i]); |
| 646 | } |
| 647 | } |
| 648 | if ( options!=null && options[Option.ANCHOR.ordinal()] !=null ) { |
| 649 | out.pushAnchorPoint(); |
| 650 | } |
| 651 | |
| 652 | int n = writeObject(out, scope, o, optionStrings); |
| 653 | if ( options!=null && options[Option.ANCHOR.ordinal()] !=null ) { |
| 654 | out.popAnchorPoint(); |
| 655 | } |
| 656 | if ( debug ) { |
| 657 | EvalExprEvent e = new EvalExprEvent(scope, start, out.index()-1, getExprStartChar(scope), getExprStopChar(scope)); |
| 658 | trackDebugEvent(scope, e); |
| 659 | } |
| 660 | return n; |
| 661 | } |
| 662 | |
| 663 | /** Generic method to emit text for an object. It differentiates |
| 664 | * between templates, iterable objects, and plain old Java objects (POJOs) |
no test coverage detected