T - the type of serialized objects processed by this serializerpublic interface Serializer<T>
Serializer serializes and deserializes data from a certain format into and from NodesNode,
JanksonSerializer| Modifier and Type | Method and Description |
|---|---|
T |
deserialize(Node node,
java.io.InputStream in)
Deserializes data from an
InputStream into a config tree. |
T |
deserialize(Node node,
T element)
Deserializes an intermediate element into a config tree.
|
Identifier |
getIdentifier() |
T |
serialize(Node node)
Serializes a config tree.
|
default void |
serialize(Node node,
java.io.OutputStream out)
Serializes a config tree and writes it to an
OutputStream. |
void |
serialize(Node node,
T additionalData,
java.io.OutputStream out)
Serializes a config tree and writes it to an
OutputStream. |
Identifier getIdentifier()
T deserialize(Node node, java.io.InputStream in) throws FiberException, java.io.IOException
InputStream into a config tree.
If the serialized tree has elements not present in the actual node, they will be collected as a separate data structure and returned.
node - the node to deserializein - the serialized data for the nodeFiberExceptionjava.io.IOExceptionT deserialize(Node node, T element) throws FiberException
If the serialized tree has elements not present in the actual node, they will be collected as a separate data structure and returned.
node - the node to deserializeelement - the serialized data for the nodeFiberExceptiondefault void serialize(Node node, java.io.OutputStream out) throws FiberException, java.io.IOException
OutputStream.node - the node to serializeout - the stream to which the serialized data is to be writtenFiberExceptionjava.io.IOExceptionvoid serialize(Node node, @Nullable T additionalData, java.io.OutputStream out) throws FiberException, java.io.IOException
OutputStream.
The caller may pass in additional data to be appended to the serialized tree. In case of conflict between the serialized tree and the additional data (eg. map representation with conflicting keys), the conflicting data from the serialized tree gets overwritten.
The additionalData may be used with the leftovers from
deserialize(Node, InputStream) to inject back unrecognized nodes.
node - the node to serializeadditionalData - data to append to the serialized treeout - the stream to which the serialized data is to be writtenFiberExceptionjava.io.IOExceptionT serialize(Node node) throws FiberException
node - the node to serializeFiberException