private static void writeArray( Writer out, Object arrayValue ) throws IOException { int size = Array.getLength( arrayValue ); writeType( out, arrayValue.getClass().getComponentType() ); out.write( TOKEN_ARR_OPEN ); out.write( COLLECTION_LINE_BREAK ); for ( int i = 0; i < size; i++ ) { writeCollectionElement(out, Array.get( arrayValue, i )); } out.write( INDENT ); out.write( TOKEN_ARR_CLOS ); }
private static void writeArray( Writer out, Object arrayValue ) throws IOException { int size = Array.getLength( arrayValue ); writeType( out, arrayValue.getClass().getComponentType() ); out.write( TOKEN_ARR_OPEN ); out.write( COLLECTION_LINE_BREAK ); for ( int i = 0; i < size; i++ ) { writeCollectionElement(out, Array.get( arrayValue, i )); } out.write( INDENT ); out.write( TOKEN_ARR_CLOS ); }
private static void writeArray( Writer out, Object arrayValue ) throws IOException { int size = Array.getLength( arrayValue ); writeType( out, arrayValue.getClass().getComponentType() ); out.write( TOKEN_ARR_OPEN ); out.write( COLLECTION_LINE_BREAK ); for ( int i = 0; i < size; i++ ) { writeCollectionElement(out, Array.get( arrayValue, i )); } out.write( INDENT ); out.write( TOKEN_ARR_CLOS ); }
private static void writeCollection( Writer out, Collection collection ) throws IOException { if ( collection.isEmpty() ) { out.write( TOKEN_VEC_OPEN ); out.write( COLLECTION_LINE_BREAK ); out.write( TOKEN_VEC_CLOS ); } else { Iterator ci = collection.iterator(); Object firstElement = ci.next(); writeType( out, firstElement.getClass() ); out.write( TOKEN_VEC_OPEN ); out.write( COLLECTION_LINE_BREAK ); writeCollectionElement( out, firstElement ); while ( ci.hasNext() ) { writeCollectionElement( out, ci.next() ); } out.write( TOKEN_VEC_CLOS ); } }
private static void writeCollection( Writer out, Collection collection ) throws IOException { if ( collection.isEmpty() ) { out.write( TOKEN_VEC_OPEN ); out.write( COLLECTION_LINE_BREAK ); out.write( TOKEN_VEC_CLOS ); } else { Iterator ci = collection.iterator(); Object firstElement = ci.next(); writeType( out, firstElement.getClass() ); out.write( TOKEN_VEC_OPEN ); out.write( COLLECTION_LINE_BREAK ); writeCollectionElement( out, firstElement ); while ( ci.hasNext() ) { writeCollectionElement( out, ci.next() ); } out.write( TOKEN_VEC_CLOS ); } }
private static void writeCollection( Writer out, Collection collection ) throws IOException { if ( collection.isEmpty() ) { out.write( TOKEN_VEC_OPEN ); out.write( COLLECTION_LINE_BREAK ); out.write( TOKEN_VEC_CLOS ); } else { Iterator ci = collection.iterator(); Object firstElement = ci.next(); writeType( out, firstElement.getClass() ); out.write( TOKEN_VEC_OPEN ); out.write( COLLECTION_LINE_BREAK ); writeCollectionElement( out, firstElement ); while ( ci.hasNext() ) { writeCollectionElement( out, ci.next() ); } out.write( TOKEN_VEC_CLOS ); } }