public final class Serializer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Serializer.Builder
Builder for serializers with non-default options.
|
Constructor and Description |
---|
Serializer(com.tinkerpop.frames.FramedGraph<?> graph)
Basic constructor.
|
Serializer(Serializer.Builder builder) |
Modifier and Type | Method and Description |
---|---|
<T extends Entity> |
entityToBundle(T item)
Convert an Entity into a Bundle that includes its @Fetch'd
relations.
|
<T extends Entity> |
entityToData(T item)
Convert a vertex frame to a raw bundle of data.
|
<T extends Entity> |
entityToJson(T item)
Serialise a vertex frame to JSON.
|
List<String> |
getIncludedProperties()
Get the list of included properties for this serializer.
|
<T extends Entity> |
traverseSubtree(T item,
TraversalCallback cb)
Run a callback every time a node in a subtree is encountered,
excepting the top-level node.
|
Bundle |
vertexToBundle(com.tinkerpop.blueprints.Vertex item)
Convert a Vertex into a Bundle that includes its @Fetch'd
relations.
|
Map<String,Object> |
vertexToData(com.tinkerpop.blueprints.Vertex item)
Convert a vertex to a raw bundle of data.
|
String |
vertexToJson(com.tinkerpop.blueprints.Vertex item)
Serialise a vertex to JSON.
|
Serializer |
withCache()
Return a serializer that caches recently-serialized items.
|
Serializer |
withDependentOnly(boolean dependentOnly) |
Serializer |
withDepth(int depth)
Create a new serializer from this one, with the given depth.
|
Serializer |
withIncludedProperties(List<String> includeProps)
Create a new serializer from this one, with extra included properties.
|
public Serializer(com.tinkerpop.frames.FramedGraph<?> graph)
public Serializer(Serializer.Builder builder)
public Serializer withIncludedProperties(List<String> includeProps)
includeProps
- a set of properties to include.public Serializer withDepth(int depth)
depth
- the maximum depth of traversalpublic Serializer withDependentOnly(boolean dependentOnly)
public List<String> getIncludedProperties()
public Serializer withCache()
public <T extends Entity> Map<String,Object> entityToData(T item) throws SerializationError
item
- The framed itemSerializationError
public Map<String,Object> vertexToData(com.tinkerpop.blueprints.Vertex item) throws SerializationError
item
- The item vertexSerializationError
public <T extends Entity> Bundle entityToBundle(T item) throws SerializationError
item
- The framed itemSerializationError
public Bundle vertexToBundle(com.tinkerpop.blueprints.Vertex item) throws SerializationError
item
- The item vertexSerializationError
public <T extends Entity> String entityToJson(T item) throws SerializationError
item
- The framed itemSerializationError
public String vertexToJson(com.tinkerpop.blueprints.Vertex item) throws SerializationError
item
- The item vertexSerializationError
public <T extends Entity> void traverseSubtree(T item, TraversalCallback cb)
item
- The itemcb
- A callback objectCopyright © 2018 The European Holocaust Research Infrastructure (EHRI). All rights reserved.