Skip to content

Commit

Permalink
GraphSON
Browse files Browse the repository at this point in the history
New Interface IGraphSONIterable
  • Loading branch information
Blondysinger committed Apr 19, 2015
1 parent b07f218 commit 24feb8f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
@@ -1,21 +1,5 @@
package com.tinkerpop.blueprints.util.io.graphson;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.MappingJsonFactory;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Element;
import com.tinkerpop.blueprints.Vertex;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.codehaus.jettison.json.JSONTokener;

import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Array;
Expand All @@ -28,7 +12,23 @@
import java.util.Map;
import java.util.Set;

import static com.tinkerpop.blueprints.util.io.graphson.ElementPropertyConfig.ElementPropertiesRule;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.codehaus.jettison.json.JSONTokener;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.MappingJsonFactory;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Element;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.util.io.graphson.ElementPropertyConfig.ElementPropertiesRule;

/**
* Helps write individual graph elements to TinkerPop JSON format known as GraphSON.
Expand Down Expand Up @@ -560,6 +560,8 @@ private static ObjectNode createJSONMap(final Map map, final List<String> proper
showTypes ? GraphSONMode.EXTENDED : GraphSONMode.NORMAL);
} else if (value.getClass().isArray()) {
value = createJSONList(convertArrayToList(value), propertyKeys, showTypes);
} else if (value instanceof IGraphSONIterable){
value = createJSONList(((IGraphSONIterable)value).getList(), propertyKeys, showTypes);
}
}

Expand Down
@@ -0,0 +1,9 @@
package com.tinkerpop.blueprints.util.io.graphson;

import java.util.List;

import com.tinkerpop.blueprints.Element;

public interface IGraphSONIterable {
public List<? extends Element> getList();
}

0 comments on commit 24feb8f

Please sign in to comment.