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