public class ArrayRepresentationHandler extends java.lang.Object implements RepresentationHandler
| Modifier and Type | Field and Description |
|---|---|
protected RepresentationHandler |
elementHandler
Handler for the array elements.
|
protected java.lang.Class<?> |
elementType
Type of the array elements.
|
| Constructor and Description |
|---|
ArrayRepresentationHandler(RepresentationHandler elementHandler,
java.lang.reflect.Type typeofArray) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canHandle(java.lang.reflect.Type type)
Checks whether this array handler can handle the given type, which is the case if it is an array type.
|
java.lang.Object |
deserializeFromRepresentation(Representation repr,
java.util.function.Function<java.lang.String,RepresentationRestorer> getRegisteredRestorer)
Deserializes the given representation using the given representation restorers.
|
static java.lang.Class<?> |
getTypeOfElements(java.lang.reflect.Type typeOfArray)
Retrieves the class of the elements of the given array type.
|
Representation |
serializeToRepresentation(java.lang.Object obj)
Serializes (creates a representation of) the given object.
|
protected RepresentationHandler elementHandler
protected java.lang.Class<?> elementType
public ArrayRepresentationHandler(RepresentationHandler elementHandler, java.lang.reflect.Type typeofArray)
public static java.lang.Class<?> getTypeOfElements(java.lang.reflect.Type typeOfArray)
typeOfArray - the type of the arraypublic static boolean canHandle(java.lang.reflect.Type type)
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 obj)
RepresentationHandlerserializeToRepresentation in interface RepresentationHandlerobj - the object to serialize