Write out an expression result that uses expression options. E.g.,
(STWriter out, InstanceScope scope, Object o, Object[] options)
| 684 | */ |
| 685 | |
| 686 | protected int writeObjectWithOptions(STWriter out, InstanceScope scope, Object o, Object[] options) { |
| 687 | int start = out.index(); // track char we're about to write |
| 688 | // precompute all option values (render all the way to strings) |
| 689 | String[] optionStrings = null; |
| 690 | if ( options !=null ) { |
| 691 | optionStrings = new String[options.length]; |
| 692 | for (int i = 0; i <Compiler.NUM_OPTIONS; i++) { |
| 693 | optionStrings[i] = toString(out, scope, options[i]); |
| 694 | } |
| 695 | } |
| 696 | if ( options !=null && options[Option.ANCHOR.ordinal()]!=null ) { |
| 697 | out.pushAnchorPoint(); |
| 698 | } |
| 699 | |
| 700 | int n = writeObject(out, scope, o, optionStrings); |
| 701 | if ( options !=null && options[Option.ANCHOR.ordinal()]!=null ) { |
| 702 | out.popAnchorPoint(); |
| 703 | } |
| 704 | if ( debug ) { |
| 705 | EvalExprEvent e = new EvalExprEvent(scope, start, out.index()-1, getExprStartChar(scope), getExprStopChar(scope)); |
| 706 | trackDebugEvent(scope, e); |
| 707 | } |
| 708 | return n; |
| 709 | } |
| 710 | |
| 711 | /** Generic method to emit text for an object. It differentiates |
| 712 | * between templates, iterable objects, and plain old Java objects (POJOs) |
no test coverage detected