(STWriter out, InstanceScope scope, Object o, String[] options)
| 742 | } |
| 743 | |
| 744 | protected int writeIterator(STWriter out, InstanceScope scope, Object o, String[] options) throws IOException { |
| 745 | if ( o==null ) return 0; |
| 746 | int n = 0; |
| 747 | Iterator<?> it = (Iterator<?>)o; |
| 748 | String separator = null; |
| 749 | if ( options !=null ) separator = options[Option.SEPARATOR.ordinal()]; |
| 750 | boolean seenAValue = false; |
| 751 | while ( it.hasNext() ) { |
| 752 | Object iterValue = it.next(); |
| 753 | // Emit separator if we're beyond first value |
| 754 | boolean needSeparator = seenAValue&& separator !=null && // we have a separator and |
| 755 | (iterValue !=null || // either we have a value options[Option.NULL.ordinal()]!=null); // or no value but null option |
| 756 | if ( needSeparator ) n += out.writeSeparator(separator); |
| 757 | int nw = writeObject(out, scope, iterValue, options); |
| 758 | if ( nw>0) seenAValue = true; |
| 759 | n += nw; |
| 760 | } |
| 761 | return n; |
| 762 | } |
| 763 | |
| 764 | protected int writePOJO(STWriter out, InstanceScope scope, Object o, String[] options) throws IOException { |
| 765 | String formatString = null; |
no test coverage detected