public class DependentRepresentationHandler extends java.lang.Object implements RepresentationHandler
RepresentationRestorer in order to be recreated.| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
restorerString
Restorer string indicating the
RepresentationRestorer to use. |
protected java.lang.reflect.Type |
typeToRestore
What type the restored object should be.
|
| Constructor and Description |
|---|
DependentRepresentationHandler(java.lang.String restorerString,
java.lang.reflect.Type typeToRestore) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canHandle(java.lang.reflect.Type type)
Checks whether this handler can handle the given type, which is the case if it implements
Representable. |
java.lang.Object |
deserializeFromRepresentation(Representation repr,
java.util.function.Function<java.lang.String,RepresentationRestorer> getRegisteredRestorer)
Deserializes the given representation using the given representation restorers.
|
Representation |
serializeToRepresentation(java.lang.Object object)
Serializes (creates a representation of) the given object.
|
protected java.lang.String restorerString
RepresentationRestorer to use.protected java.lang.reflect.Type typeToRestore
public DependentRepresentationHandler(java.lang.String restorerString,
java.lang.reflect.Type typeToRestore)
public static boolean canHandle(java.lang.reflect.Type type)
Representable.type - the type to checkpublic java.lang.Object deserializeFromRepresentation(Representation repr, java.util.function.Function<java.lang.String,RepresentationRestorer> getRegisteredRestorer)
RepresentationHandlerdeserializeFromRepresentation in interface RepresentationHandlerrepr - the representation to deserializegetRegisteredRestorer - maps representation restorer names to the restorerspublic Representation serializeToRepresentation(java.lang.Object object)
RepresentationHandlerserializeToRepresentation in interface RepresentationHandlerobject - the object to serialize