public static < E extends Throwable > String buildString ( AStatement1 < AJsonSerHelper , E > code ) throws E { final ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; code . apply ( new AJsonSerHelper ( baos ) ) ; return new String ( baos . toByteArray ( ) , UTF_8 ) ; }
This is a convenience method for building simple JSON strings . It passes an AJsonSerHelper to a callback and builds a string based on what the callback does with it .