public < T > String serialize ( T object ) throws JSONSerializerException { Util . throwIfNull ( object ) ; String value ; try { value = OBJECT_MAPPER . writeValueAsString ( object ) ; } catch ( JsonGenerationException e ) { throw new JSONSerializerException ( e ) ; } catch ( JsonMappingException e ) { throw new JSONSerializerException ( e ) ; } catch ( IOException e ) { throw new JSONSerializerException ( e ) ; } return value ; }
Serialize an object to JSON .