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 NodesConfigTree,
JanksonSerializer| Modifier and Type | Method and Description |
|---|---|
T |
deserialize(ConfigTree tree,
java.io.InputStream in)
Deserializes data from an
InputStream into a config tree. |
T |
deserialize(ConfigTree tree,
T element)
Deserializes an intermediate element into a config tree.
|
FiberId |
getIdentifier() |
T |
serialize(ConfigTree tree)
Serializes a config tree.
|
default void |
serialize(ConfigTree tree,
java.io.OutputStream out)
Serializes a config tree and writes it to an
OutputStream. |
void |
serialize(ConfigTree tree,
T additionalData,
java.io.OutputStream out)
Serializes a config tree and writes it to an
OutputStream. |
FiberId getIdentifier()
T deserialize(ConfigTree tree, 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.
tree - the node to deserializein - the serialized data for the nodeFiberExceptionjava.io.IOExceptionT deserialize(ConfigTree tree, 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.
tree - the node to deserializeelement - the serialized data for the nodeFiberExceptiondefault void serialize(ConfigTree tree, java.io.OutputStream out) throws FiberException, java.io.IOException
OutputStream.tree - the node to serializeout - the stream to which the serialized data is to be writtenFiberExceptionjava.io.IOExceptionvoid serialize(ConfigTree tree, @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(ConfigTree, InputStream) to inject back unrecognized nodes.
tree - 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(ConfigTree tree) throws FiberException
tree - the node to serializeFiberException