(STWriter out, InstanceScope scope, Object value)
| 1110 | } |
| 1111 | |
| 1112 | protected String toString(STWriter out, InstanceScope scope, Object value) { |
| 1113 | if ( value !=null ) { |
| 1114 | if ( value.getClass()==String.class ) return (String)value; |
| 1115 | // if not string already, must evaluate it |
| 1116 | StringWriter sw = new StringWriter(); |
| 1117 | STWriter stw; |
| 1118 | try { |
| 1119 | Class<? extends STWriter> writerClass = out.getClass(); |
| 1120 | Constructor<? extends STWriter> ctor = writerClass.getConstructor(Writer.class); |
| 1121 | stw = ctor.newInstance(sw); |
| 1122 | } |
| 1123 | catch (Exception e) { |
| 1124 | stw = new AutoIndentWriter(sw); |
| 1125 | errMgr.runTimeError(this, scope, ErrorType.WRITER_CTOR_ISSUE, out.getClass().getSimpleName()); |
| 1126 | } |
| 1127 | if ( debug&& !scope.earlyEval ) { |
| 1128 | scope = new InstanceScope(scope, scope.st); |
| 1129 | scope.earlyEval = true; |
| 1130 | } |
| 1131 | writeObjectNoOptions(stw, scope, value); |
| 1132 | return sw.toString(); |
| 1133 | } |
| 1134 | return null; |
| 1135 | } |
| 1136 | |
| 1137 | public Object convertAnythingIteratableToIterator(InstanceScope scope, Object o) { |
| 1138 | Iterator<?> iter = null; |
no test coverage detected