Examples of JsonGenerationException


Examples of com.facebook.presto.hive.shaded.org.codehaus.jackson.JsonGenerationException

   
    @Override
    public void serialize(Object value, JsonGenerator jgen, SerializerProvider provider)
        throws IOException, JsonGenerationException
    {
        throw new JsonGenerationException(_msg);
    }
View Full Code Here

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

Examples of com.fasterxml.jackson.core.JsonGenerationException

      }

      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

Examples of com.fasterxml.jackson.core.JsonGenerationException

    }

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

Examples of com.fasterxml.jackson.core.JsonGenerationException

    }

    @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

Examples of com.fasterxml.jackson.core.JsonGenerationException

      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

Examples of com.fasterxml.jackson.core.JsonGenerationException

*/
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

Examples of com.fasterxml.jackson.core.JsonGenerationException

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

Examples of javax.json.stream.JsonGenerationException

    }

    @Override
    public JsonGenerator writeStartObject(String name) {
        if (currentContext.scope != Scope.IN_OBJECT) {
            throw new JsonGenerationException(
                    JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope));
        }
        writeName(name);
        writeChar('{');
        stack.push(currentContext);
View Full Code Here

Examples of javax.json.stream.JsonGenerationException

    }

    @Override
    public JsonGenerator write(String name, String fieldValue) {
        if (currentContext.scope != Scope.IN_OBJECT) {
            throw new JsonGenerationException(
                    JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope));
        }
        writeName(name);
        writeEscapedString(fieldValue);
        return this;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.