Package com.github.nmorel.gwtjackson.client.exception

Examples of com.github.nmorel.gwtjackson.client.exception.JsonSerializationException


            @Override
            public String write( T input ) {
                try {
                    return objectMapper.writeValueAsString( input );
                } catch ( JsonProcessingException e ) {
                    throw new JsonSerializationException( e );
                }
            }
        };
    }
View Full Code Here


            @Override
            public String write( T input ) {
                try {
                    return objectMapper.writeValueAsString( input );
                } catch ( JsonProcessingException e ) {
                    throw new JsonSerializationException( e );
                }
            }
        };
    }
View Full Code Here

     *
     * @return a {@link JsonSerializationException} with the given message
     */
    public JsonSerializationException traceError( Object value, String message ) {
        getLogger().log( Level.SEVERE, message );
        return new JsonSerializationException( message );
    }
View Full Code Here

     * @param writer current writer
     *
     * @return a {@link JsonSerializationException} with the given message
     */
    public JsonSerializationException traceError( Object value, String message, JsonWriter writer ) {
        JsonSerializationException exception = traceError( value, message );
        traceWriterInfo( value, writer );
        return exception;
    }
View Full Code Here

     * @return a {@link JsonSerializationException} if we wrap the exceptions, the cause otherwise
     */
    public RuntimeException traceError( Object value, RuntimeException cause ) {
        getLogger().log( Level.SEVERE, "Error during serialization", cause );
        if ( wrapExceptions ) {
            return new JsonSerializationException( cause );
        } else {
            return cause;
        }
    }
View Full Code Here

  @Override
  public void close() {
    int size = stackSize;
    if (size > 1 || size == 1 && stack.get(size - 1) != JsonScope.NONEMPTY_DOCUMENT) {
      logger.log(Level.SEVERE, "Incomplete document");
      throw new JsonSerializationException("Incomplete document");
    }
    stackSize = 0;
  }
View Full Code Here

  @Override
  public void close() {
    int size = stackSize;
    if (size > 1 || size == 1 && stack.get(size - 1) != JsonScope.NONEMPTY_DOCUMENT) {
      logger.log(Level.SEVERE, "Incomplete document");
      throw new JsonSerializationException("Incomplete document");
    }
    stackSize = 0;
  }
View Full Code Here

            assertSame( exception, e );
        }
    }

    public void testSerializeEncodingException() {
        final JsonSerializationException jsonSerializationException = new JsonSerializationException();
        ObjectWriter<String> writer = new AbstractObjectWriter<String>( null ) {
            @Override
            protected JsonSerializer<String> newSerializer() {
                return new JsonSerializer<String>() {
                    @Override
View Full Code Here

TOP

Related Classes of com.github.nmorel.gwtjackson.client.exception.JsonSerializationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.