org.apache.tinkerpop.shaded.jackson.core.JsonGenerationException Java Examples

The following examples show how to use org.apache.tinkerpop.shaded.jackson.core.JsonGenerationException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractGraphSONMessageSerializerV1d0.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
@Override
public void serialize(final JsonBuilder json, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
        throws IOException, JsonGenerationException {
    // the JSON from the builder will already be started/ended as array or object...just need to surround it
    // with appropriate chars to fit into the serialization pattern.
    jsonGenerator.writeRaw(":");
    jsonGenerator.writeRaw(json.toString());
    jsonGenerator.writeRaw(",");
}
 
Example #2
Source File: SchemaTable.java    From sqlg with MIT License 5 votes vote down vote up
@Override
public void serialize(final SchemaTable schemaTable, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
        throws IOException, JsonGenerationException {
    // when types are not embedded, stringify or resort to JSON primitive representations of the
    // type so that non-jvm languages can better interoperate with the TinkerPop stack.
    final Map<String, Object> m = new LinkedHashMap<>();
    m.put("schema", schemaTable.getSchema());
    m.put("table", schemaTable.getTable());
    jsonGenerator.writeObject(m);
}
 
Example #3
Source File: SchemaTable.java    From sqlg with MIT License 5 votes vote down vote up
@Override
public void serialize(final SchemaTable schemaTable, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
        throws IOException, JsonGenerationException {
    // when types are not embedded, stringify or resort to JSON primitive representations of the
    // type so that non-jvm languages can better interoperate with the TinkerPop stack.
    jsonGenerator.writeString(schemaTable.toString());
}
 
Example #4
Source File: CustomId.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
@Override
public void serialize(final CustomId customId, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
        throws IOException, JsonGenerationException {
    final Map<String, Object> m = new HashMap<>();
    m.put("cluster", customId.getCluster());
    m.put("elementId", customId.getElementId());
    jsonGenerator.writeObject(m);
}
 
Example #5
Source File: CustomId.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
@Override
public void serialize(final CustomId customId, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
        throws IOException, JsonGenerationException {
    // when types are not embedded, stringify or resort to JSON primitive representations of the
    // type so that non-jvm languages can better interoperate with the TinkerPop stack.
    jsonGenerator.writeString(customId.toString());
}
 
Example #6
Source File: CustomId.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
@Override
public void serialize(final CustomId customId, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
        throws IOException, JsonGenerationException {
    // when types are not embedded, stringify or resort to JSON primitive representations of the
    // type so that non-jvm languages can better interoperate with the TinkerPop stack.
    jsonGenerator.writeString(customId.toString());
}
 
Example #7
Source File: ToyPoint.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
@Override
public void serialize(final ToyPoint toyPoint, final JsonGenerator jsonGenerator,
                      final SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
    jsonGenerator.writeStartObject();
    jsonGenerator.writeObjectField("x", toyPoint.x);
    jsonGenerator.writeObjectField("y", toyPoint.y);
    jsonGenerator.writeEndObject();
}
 
Example #8
Source File: ToyTriangle.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
@Override
public void serialize(final ToyTriangle toyTriangle, final JsonGenerator jsonGenerator,
                      final SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
    jsonGenerator.writeStartObject();
    jsonGenerator.writeObjectField("x", toyTriangle.x);
    jsonGenerator.writeObjectField("y", toyTriangle.y);
    jsonGenerator.writeObjectField("z", toyTriangle.z);
    jsonGenerator.writeEndObject();
}
 
Example #9
Source File: GraphSONSerializersV2d0.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
@Override
public void serialize(final Tree tree, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
    jsonGenerator.writeStartArray();
    final Set<Map.Entry<Element, Tree>> set = tree.entrySet();
    for (Map.Entry<Element, Tree> entry : set) {
        jsonGenerator.writeStartObject();
        jsonGenerator.writeObjectField(GraphSONTokens.KEY, entry.getKey());
        jsonGenerator.writeObjectField(GraphSONTokens.VALUE, entry.getValue());
        jsonGenerator.writeEndObject();
    }
    jsonGenerator.writeEndArray();
}
 
Example #10
Source File: GraphSONSerializersV2d0.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
@Override
public void serialize(final Path path, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
        throws IOException, JsonGenerationException {
    jsonGenerator.writeStartObject();

    // paths shouldn't serialize with properties if the path contains graph elements
    final Path p = DetachedFactory.detach(path, false);
    jsonGenerator.writeObjectField(GraphSONTokens.LABELS, p.labels());
    jsonGenerator.writeObjectField(GraphSONTokens.OBJECTS, p.objects());

    jsonGenerator.writeEndObject();
}
 
Example #11
Source File: GraphSONSerializersV3d0.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
@Override
public void serialize(final Tree tree, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
    jsonGenerator.writeStartArray();
    final Set<Map.Entry<Element, Tree>> set = tree.entrySet();
    for (Map.Entry<Element, Tree> entry : set) {
        jsonGenerator.writeStartObject();
        jsonGenerator.writeObjectField(GraphSONTokens.KEY, entry.getKey());
        jsonGenerator.writeObjectField(GraphSONTokens.VALUE, entry.getValue());
        jsonGenerator.writeEndObject();
    }
    jsonGenerator.writeEndArray();
}
 
Example #12
Source File: GraphSONSerializersV3d0.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
@Override
public void serialize(final Path path, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
        throws IOException, JsonGenerationException {
    jsonGenerator.writeStartObject();

    // paths shouldn't serialize with properties if the path contains graph elements
    final Path p = DetachedFactory.detach(path, false);
    jsonGenerator.writeObjectField(GraphSONTokens.LABELS, p.labels());
    jsonGenerator.writeObjectField(GraphSONTokens.OBJECTS, p.objects());

    jsonGenerator.writeEndObject();
}
 
Example #13
Source File: AbstractGraphSONMessageSerializerV2d0.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
@Override
public void serialize(final JsonBuilder json, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
        throws IOException, JsonGenerationException {
    // the JSON from the builder will already be started/ended as array or object...just need to surround it
    // with appropriate chars to fit into the serialization pattern.
    jsonGenerator.writeRaw(":");
    jsonGenerator.writeRaw(json.toString());
    jsonGenerator.writeRaw(",");
}
 
Example #14
Source File: GraphSONSerializersV1d0.java    From tinkerpop with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(final Path path, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
        throws IOException, JsonGenerationException {
    ser(path, jsonGenerator, null);
}
 
Example #15
Source File: GraphSONSerializersV1d0.java    From tinkerpop with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(final Tree tree, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
    ser(tree, jsonGenerator, null);
}
 
Example #16
Source File: StarGraphGraphSONSerializerV3d0.java    From tinkerpop with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(final DirectionalStarGraph starGraph, final JsonGenerator jsonGenerator,
                      final SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
    ser(starGraph, jsonGenerator, serializerProvider, null);
}
 
Example #17
Source File: StarGraphGraphSONSerializerV1d0.java    From tinkerpop with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(final DirectionalStarGraph starGraph, final JsonGenerator jsonGenerator,
                      final SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
    ser(starGraph, jsonGenerator, serializerProvider, null);
}
 
Example #18
Source File: StarGraphGraphSONSerializerV2d0.java    From tinkerpop with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(final DirectionalStarGraph starGraph, final JsonGenerator jsonGenerator,
                      final SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
    ser(starGraph, jsonGenerator, serializerProvider, null);
}
 
Example #19
Source File: GraphSONMessageSerializerV2d0Test.java    From tinkerpop with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(final Color color, final JsonGenerator jsonGenerator,
                      final SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
    jsonGenerator.writeBoolean(color.equals(Color.RED));
}
 
Example #20
Source File: GraphSONMessageSerializerV1d0Test.java    From tinkerpop with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(final Color color, final JsonGenerator jsonGenerator,
                      final SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
    jsonGenerator.writeBoolean(color.equals(Color.RED));
}
 
Example #21
Source File: AbstractGraphSONMessageSerializerV1d0.java    From tinkerpop with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(final ResponseMessage responseMessage, final JsonGenerator jsonGenerator,
                      final SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
    ser(responseMessage, jsonGenerator, serializerProvider, null);
}
 
Example #22
Source File: TitanGraphSONModule.java    From titan1withtp3.1 with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(final RelationIdentifier relationIdentifier, final JsonGenerator jsonGenerator,
                      final SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
    jsonGenerator.writeString(relationIdentifier.toString());
}