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