(STWriter out, InstanceScope scope, Object value)
| 1071 | } |
| 1072 | |
| 1073 | protected String toString(STWriter out, InstanceScope scope, Object value) { |
| 1074 | if ( value!=null ) { |
| 1075 | if ( value.getClass()==String.class ) return (String)value; |
| 1076 | // if not string already, must evaluate it |
| 1077 | StringWriter sw = new StringWriter(); |
| 1078 | STWriter stw; |
| 1079 | try { |
| 1080 | Class<? extends STWriter> writerClass = out.getClass(); |
| 1081 | Constructor<? extends STWriter> ctor = writerClass.getConstructor(Writer.class); |
| 1082 | stw = ctor.newInstance(sw); |
| 1083 | } |
| 1084 | catch (Exception e) { |
| 1085 | stw = new AutoIndentWriter(sw); |
| 1086 | errMgr.runTimeError(this, scope, ErrorType.WRITER_CTOR_ISSUE, out.getClass().getSimpleName()); |
| 1087 | } |
| 1088 | if ( debug && !scope.earlyEval ) { |
| 1089 | scope = new InstanceScope(scope, scope.st); |
| 1090 | scope.earlyEval = true; |
| 1091 | } |
| 1092 | writeObjectNoOptions(stw, scope, value); |
| 1093 | return sw.toString(); |
| 1094 | } |
| 1095 | return null; |
| 1096 | } |
| 1097 | |
| 1098 | public Object convertAnythingIteratableToIterator(InstanceScope scope, Object o) { |
| 1099 | Iterator<?> iter = null; |
no test coverage detected