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