gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3.java [712:793]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        @Override
        public boolean isCachable() {
            return true;
        }
    }

    static class TreeJacksonDeserializer extends StdDeserializer<Tree> {

        public TreeJacksonDeserializer() {
            super(Tree.class);
        }

        @Override
        public Tree deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
            final List<Map> data = deserializationContext.readValue(jsonParser, List.class);
            final Tree t = new Tree();
            for (Map<String, Object> entry : data) {
                t.put(entry.get(GraphSONTokens.KEY), entry.get(GraphSONTokens.VALUE));
            }
            return t;
        }

        @Override
        public boolean isCachable() {
            return true;
        }
    }

    static class IntegerJackonsDeserializer extends StdDeserializer<Integer> {

        protected IntegerJackonsDeserializer() {
            super(Integer.class);
        }

        @Override
        public Integer deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
            return jsonParser.getIntValue();
        }

        @Override
        public boolean isCachable() {
            return true;
        }
    }

    static class DoubleJacksonDeserializer extends StdDeserializer<Double> {

        protected DoubleJacksonDeserializer() {
            super(Double.class);
        }

        @Override
        public Double deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
            if (jsonParser.getCurrentToken().isNumeric())
                return jsonParser.getDoubleValue();
            else  {
                final String numberText = jsonParser.getValueAsString();
                if ("NaN".equalsIgnoreCase(numberText))
                    return Double.NaN;
                else if ("-Infinity".equals(numberText) || "-INF".equalsIgnoreCase(numberText))
                    return Double.NEGATIVE_INFINITY;
                else if ("Infinity".equals(numberText) || "INF".equals(numberText))
                    return Double.POSITIVE_INFINITY;
                else
                    throw new IllegalStateException("Double value unexpected: " + numberText);
            }

        }

        @Override
        public boolean isCachable() {
            return true;
        }
    }

    /**
     * When doing untyped serialization graph objects get a special "type" field appended.
     */
    private static void writeTypeForGraphObjectIfUntyped(final JsonGenerator jsonGenerator, final TypeInfo typeInfo,
                                                         final String type) throws IOException {
        if (typeInfo == TypeInfo.NO_TYPES) {
            jsonGenerator.writeStringField(GraphSONTokens.TYPE, type);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV4.java [564:645]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        @Override
        public boolean isCachable() {
            return true;
        }
    }

    static class TreeJacksonDeserializer extends StdDeserializer<Tree> {

        public TreeJacksonDeserializer() {
            super(Tree.class);
        }

        @Override
        public Tree deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
            final List<Map> data = deserializationContext.readValue(jsonParser, List.class);
            final Tree t = new Tree();
            for (Map<String, Object> entry : data) {
                t.put(entry.get(GraphSONTokens.KEY), entry.get(GraphSONTokens.VALUE));
            }
            return t;
        }

        @Override
        public boolean isCachable() {
            return true;
        }
    }

    static class IntegerJackonsDeserializer extends StdDeserializer<Integer> {

        protected IntegerJackonsDeserializer() {
            super(Integer.class);
        }

        @Override
        public Integer deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
            return jsonParser.getIntValue();
        }

        @Override
        public boolean isCachable() {
            return true;
        }
    }

    static class DoubleJacksonDeserializer extends StdDeserializer<Double> {

        protected DoubleJacksonDeserializer() {
            super(Double.class);
        }

        @Override
        public Double deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
            if (jsonParser.getCurrentToken().isNumeric())
                return jsonParser.getDoubleValue();
            else  {
                final String numberText = jsonParser.getValueAsString();
                if ("NaN".equalsIgnoreCase(numberText))
                    return Double.NaN;
                else if ("-Infinity".equals(numberText) || "-INF".equalsIgnoreCase(numberText))
                    return Double.NEGATIVE_INFINITY;
                else if ("Infinity".equals(numberText) || "INF".equals(numberText))
                    return Double.POSITIVE_INFINITY;
                else
                    throw new IllegalStateException("Double value unexpected: " + numberText);
            }

        }

        @Override
        public boolean isCachable() {
            return true;
        }
    }

    /**
     * When doing untyped serialization graph objects get a special "type" field appended.
     */
    private static void writeTypeForGraphObjectIfUntyped(final JsonGenerator jsonGenerator, final TypeInfo typeInfo,
                                                         final String type) throws IOException {
        if (typeInfo == TypeInfo.NO_TYPES) {
            jsonGenerator.writeStringField(GraphSONTokens.TYPE, type);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



