public class GraphSONUtility extends Object
| Constructor and Description |
|---|
GraphSONUtility(GraphSONMode mode,
ElementFactory factory)
A GraphSONUtiltiy that includes all properties of vertices and edges.
|
GraphSONUtility(GraphSONMode mode,
ElementFactory factory,
ElementPropertyConfig config) |
GraphSONUtility(GraphSONMode mode,
ElementFactory factory,
Set<String> vertexPropertyKeys,
Set<String> edgePropertyKeys)
A GraphSONUtility that includes the specified properties.
|
| Modifier and Type | Method and Description |
|---|---|
Edge |
edgeFromJson(InputStream json,
Vertex out,
Vertex in)
Creates an edge from GraphSON using settings supplied in the constructor.
|
static Edge |
edgeFromJson(InputStream json,
Vertex out,
Vertex in,
ElementFactory factory,
GraphSONMode mode,
Set<String> propertyKeys)
Reads an individual Edge from JSON.
|
Edge |
edgeFromJson(com.fasterxml.jackson.databind.JsonNode json,
Vertex out,
Vertex in)
Creates an edge from GraphSON using settings supplied in the constructor.
|
static Edge |
edgeFromJson(com.fasterxml.jackson.databind.JsonNode json,
Vertex out,
Vertex in,
ElementFactory factory,
GraphSONMode mode,
Set<String> propertyKeys)
Reads an individual Edge from JSON.
|
Edge |
edgeFromJson(org.codehaus.jettison.json.JSONObject json,
Vertex out,
Vertex in)
Creates an edge from GraphSON using settings supplied in the constructor.
|
static Edge |
edgeFromJson(org.codehaus.jettison.json.JSONObject json,
Vertex out,
Vertex in,
ElementFactory factory,
GraphSONMode mode,
Set<String> propertyKeys)
Reads an individual Edge from JSON.
|
Edge |
edgeFromJson(String json,
Vertex out,
Vertex in)
Creates an edge from GraphSON using settings supplied in the constructor.
|
static Edge |
edgeFromJson(String json,
Vertex out,
Vertex in,
ElementFactory factory,
GraphSONMode mode,
Set<String> propertyKeys)
Reads an individual Edge from JSON.
|
org.codehaus.jettison.json.JSONObject |
jsonFromElement(Element element)
Creates GraphSON for a single graph element.
|
static org.codehaus.jettison.json.JSONObject |
jsonFromElement(Element element,
Set<String> propertyKeys,
GraphSONMode mode)
Creates a Jettison JSONObject from a graph element.
|
com.fasterxml.jackson.databind.node.ObjectNode |
objectNodeFromElement(Element element)
Creates GraphSON for a single graph element.
|
static com.fasterxml.jackson.databind.node.ObjectNode |
objectNodeFromElement(Element element,
Set<String> propertyKeys,
GraphSONMode mode)
Creates a Jackson ObjectNode from a graph element.
|
Vertex |
vertexFromJson(InputStream json)
Creates a vertex from GraphSON using settings supplied in the constructor.
|
static Vertex |
vertexFromJson(InputStream json,
ElementFactory factory,
GraphSONMode mode,
Set<String> propertyKeys)
Reads an individual Vertex from JSON.
|
Vertex |
vertexFromJson(com.fasterxml.jackson.databind.JsonNode json)
Creates a vertex from GraphSON using settings supplied in the constructor.
|
static Vertex |
vertexFromJson(com.fasterxml.jackson.databind.JsonNode json,
ElementFactory factory,
GraphSONMode mode,
Set<String> propertyKeys)
Reads an individual Vertex from JSON.
|
Vertex |
vertexFromJson(org.codehaus.jettison.json.JSONObject json)
Creates a vertex from GraphSON using settings supplied in the constructor.
|
static Vertex |
vertexFromJson(org.codehaus.jettison.json.JSONObject json,
ElementFactory factory,
GraphSONMode mode,
Set<String> propertyKeys)
Reads an individual Vertex from JSON.
|
Vertex |
vertexFromJson(String json)
Creates a vertex from GraphSON using settings supplied in the constructor.
|
static Vertex |
vertexFromJson(String json,
ElementFactory factory,
GraphSONMode mode,
Set<String> propertyKeys)
Reads an individual Vertex from JSON.
|
public GraphSONUtility(GraphSONMode mode, ElementFactory factory)
public GraphSONUtility(GraphSONMode mode, ElementFactory factory, Set<String> vertexPropertyKeys, Set<String> edgePropertyKeys)
public GraphSONUtility(GraphSONMode mode, ElementFactory factory, ElementPropertyConfig config)
public Vertex vertexFromJson(org.codehaus.jettison.json.JSONObject json) throws IOException
IOExceptionpublic Vertex vertexFromJson(String json) throws IOException
IOExceptionpublic Vertex vertexFromJson(InputStream json) throws IOException
IOExceptionpublic Vertex vertexFromJson(com.fasterxml.jackson.databind.JsonNode json) throws IOException
IOExceptionpublic Edge edgeFromJson(org.codehaus.jettison.json.JSONObject json, Vertex out, Vertex in) throws IOException
IOExceptionpublic Edge edgeFromJson(String json, Vertex out, Vertex in) throws IOException
IOExceptionpublic Edge edgeFromJson(InputStream json, Vertex out, Vertex in) throws IOException
IOExceptionpublic Edge edgeFromJson(com.fasterxml.jackson.databind.JsonNode json, Vertex out, Vertex in) throws IOException
IOExceptionpublic org.codehaus.jettison.json.JSONObject jsonFromElement(Element element) throws org.codehaus.jettison.json.JSONException
org.codehaus.jettison.json.JSONExceptionpublic com.fasterxml.jackson.databind.node.ObjectNode objectNodeFromElement(Element element)
public static Vertex vertexFromJson(org.codehaus.jettison.json.JSONObject json, ElementFactory factory, GraphSONMode mode, Set<String> propertyKeys) throws IOException
json - a single vertex in GraphSON format as Jettison JSONObjectfactory - the factory responsible for constructing graph elementsmode - the mode of the GraphSONpropertyKeys - a list of keys to include on reading of element propertiesIOExceptionpublic static Vertex vertexFromJson(String json, ElementFactory factory, GraphSONMode mode, Set<String> propertyKeys) throws IOException
json - a single vertex in GraphSON format as a String.factory - the factory responsible for constructing graph elementsmode - the mode of the GraphSONpropertyKeys - a list of keys to include on reading of element propertiesIOExceptionpublic static Vertex vertexFromJson(InputStream json, ElementFactory factory, GraphSONMode mode, Set<String> propertyKeys) throws IOException
json - a single vertex in GraphSON format as an InputStream.factory - the factory responsible for constructing graph elementsmode - the mode of the GraphSONpropertyKeys - a list of keys to include on reading of element propertiesIOExceptionpublic static Vertex vertexFromJson(com.fasterxml.jackson.databind.JsonNode json, ElementFactory factory, GraphSONMode mode, Set<String> propertyKeys) throws IOException
json - a single vertex in GraphSON format as Jackson JsonNodefactory - the factory responsible for constructing graph elementsmode - the mode of the GraphSONpropertyKeys - a list of keys to include on reading of element propertiesIOExceptionpublic static Edge edgeFromJson(org.codehaus.jettison.json.JSONObject json, Vertex out, Vertex in, ElementFactory factory, GraphSONMode mode, Set<String> propertyKeys) throws IOException
json - a single edge in GraphSON format as a Jettison JSONObjectfactory - the factory responsible for constructing graph elementsmode - the mode of the GraphSONpropertyKeys - a list of keys to include when reading of element propertiesIOExceptionpublic static Edge edgeFromJson(String json, Vertex out, Vertex in, ElementFactory factory, GraphSONMode mode, Set<String> propertyKeys) throws IOException
json - a single edge in GraphSON format as a Stringfactory - the factory responsible for constructing graph elementsmode - the mode of the GraphSONpropertyKeys - a list of keys to include when reading of element propertiesIOExceptionpublic static Edge edgeFromJson(InputStream json, Vertex out, Vertex in, ElementFactory factory, GraphSONMode mode, Set<String> propertyKeys) throws IOException
json - a single edge in GraphSON format as an InputStreamfactory - the factory responsible for constructing graph elementsmode - the mode of the GraphSONpropertyKeys - a list of keys to include when reading of element propertiesIOExceptionpublic static Edge edgeFromJson(com.fasterxml.jackson.databind.JsonNode json, Vertex out, Vertex in, ElementFactory factory, GraphSONMode mode, Set<String> propertyKeys) throws IOException
json - a single edge in GraphSON format as a Jackson JsonNodefactory - the factory responsible for constructing graph elementsmode - the mode of the GraphSONpropertyKeys - a list of keys to include when reading of element propertiesIOExceptionpublic static org.codehaus.jettison.json.JSONObject jsonFromElement(Element element, Set<String> propertyKeys, GraphSONMode mode) throws org.codehaus.jettison.json.JSONException
element - the graph element to convert to JSON.propertyKeys - The property keys at the root of the element to serialize. If null, then all keys are serialized.mode - the type of GraphSON to be generated.org.codehaus.jettison.json.JSONExceptionpublic static com.fasterxml.jackson.databind.node.ObjectNode objectNodeFromElement(Element element, Set<String> propertyKeys, GraphSONMode mode)
element - the graph element to convert to JSON.propertyKeys - The property keys at the root of the element to serialize. If null, then all keys are serialized.mode - The type of GraphSON to generate.Copyright © 2010-2014. All Rights Reserved.