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 Project: tinkerpop   Author: apache   File: AbstractGraphSONMessageSerializerV1d0.java    License: 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 Project: tinkerpop   Author: apache   File: AbstractGraphSONMessageSerializerV2d0.java    License: 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 #3
Source Project: tinkerpop   Author: apache   File: GraphSONSerializersV3d0.java    License: 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 #4
Source Project: tinkerpop   Author: apache   File: GraphSONSerializersV3d0.java    License: 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 #5
Source Project: tinkerpop   Author: apache   File: GraphSONSerializersV2d0.java    License: 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 #6
Source Project: tinkerpop   Author: apache   File: GraphSONSerializersV2d0.java    License: 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 #7
Source Project: tinkerpop   Author: apache   File: ToyTriangle.java    License: 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 #8
Source Project: tinkerpop   Author: apache   File: ToyPoint.java    License: 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 #9
Source Project: tinkerpop   Author: apache   File: CustomId.java    License: 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 #10
Source Project: tinkerpop   Author: apache   File: CustomId.java    License: 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 #11
Source Project: tinkerpop   Author: apache   File: CustomId.java    License: 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 #12
Source Project: sqlg   Author: pietermartin   File: SchemaTable.java    License: 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 #13
Source Project: sqlg   Author: pietermartin   File: SchemaTable.java    License: 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 #14
Source Project: titan1withtp3.1   Author: graben1437   File: TitanGraphSONModule.java    License: 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());
}
 
Example #15
Source Project: tinkerpop   Author: apache   File: AbstractGraphSONMessageSerializerV1d0.java    License: 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 #16
Source Project: tinkerpop   Author: apache   File: GraphSONMessageSerializerV1d0Test.java    License: 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 #17
Source Project: tinkerpop   Author: apache   File: GraphSONMessageSerializerV2d0Test.java    License: 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 #18
Source Project: tinkerpop   Author: apache   File: StarGraphGraphSONSerializerV2d0.java    License: 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 Project: tinkerpop   Author: apache   File: StarGraphGraphSONSerializerV1d0.java    License: 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 #20
Source Project: tinkerpop   Author: apache   File: StarGraphGraphSONSerializerV3d0.java    License: 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 #21
Source Project: tinkerpop   Author: apache   File: GraphSONSerializersV1d0.java    License: 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 #22
Source Project: tinkerpop   Author: apache   File: GraphSONSerializersV1d0.java    License: 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);
}