Package com.fasterxml.jackson.core

Examples of com.fasterxml.jackson.core.JsonGenerationException


                    .writeValueAsBytes(value.get("metadata"));
            jgen.writeRawValue(new String(metadata));
        }
        else
        {
            throw new JsonGenerationException("Missing metadata start tag");
        }
    }
View Full Code Here


      }

      final Link id = resource.getId();

      if (id == null) {
        throw new JsonGenerationException(String.format("No self link found resource %s!", resource));
      }

      List<Link> links = new ArrayList<Link>();
      links.addAll(resource.getLinks());
View Full Code Here

    }

    @Test
    public void testOnException_JsonEx() {
        Assert.assertEquals(RecoveryStrategy.PROCEED,
            new DefaultExceptionHandler().onException(null, new JsonGenerationException("foo"), null));
    }
View Full Code Here

    }

    @Test
    public void sendEventShouldNotFailWhenObjectMapperThrowsException()
        throws Exception {
        doThrow(new JsonGenerationException("Nothing serious!"))
            .when(mapper).writeValueAsString(any());
        Event event = mock(Event.class);

        eventSinkImpl.queueEvent(event);
        verify(mockClientProducer, never()).send(any(ClientMessage.class));
View Full Code Here

      case JsonWriteContext.STATUS_OK_AFTER_COMMA:
        gen.writeRaw(',');
        break;
       
      case JsonWriteContext.STATUS_EXPECT_NAME:
        throw new JsonGenerationException("Can not write string value here");
      }
      gen.writeRaw('"');
      for (char c : value.toCharArray()) {
        if (c >= 0x80)
          writeUnicodeEscape(gen, c); // use generic escaping for all
View Full Code Here

*/
public abstract class BsonSerializer<T> extends JsonSerializer<T> {
  @Override
  public void serialize(T t, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
    if (!(jsonGenerator instanceof BsonGenerator)) {
      throw new JsonGenerationException("BsonSerializer can " +
          "only be used with BsonGenerator");
    }
    serialize(t, (BsonGenerator) jsonGenerator, serializerProvider);
  }
View Full Code Here

public abstract class BsonDeserializer<T> extends JsonDeserializer<T> {
  @Override
  public T deserialize(JsonParser jsonParser, DeserializationContext ctxt)
      throws IOException, JsonProcessingException {
    if (!(jsonParser instanceof BsonParser)) {
      throw new JsonGenerationException("BsonDeserializer can " +
          "only be used with BsonParser");
    }
    return deserialize((BsonParser)jsonParser, ctxt);
  }
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.core.JsonGenerationException

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.