|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codegist.crest.serializer.Serializers
public final class Serializers
getFor(java.util.Map, java.lang.reflect.Type)
Method Summary | |
---|---|
static Serializer |
getFor(Map<String,Object> customProperties,
Type type)
Handy method to retrieve a serializer instance for the given Type using the given customProperties following the behavior described by CRest for amethod argument serialization. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Serializer getFor(Map<String,Object> customProperties, Type type)
Handy method to retrieve a serializer instance for the given Type using the given customProperties following the behavior described by CRest
for amethod argument serialization.
The returned serializer is:
- a serializer from the map if the type match
- otherwise an instance of DateSerializer
if no serializer for the given type has been found in the map and the type is a Date
that serialize to ISO-8601 date format by default.
- otherwise an instance of ArraySerializer
if the type happens to be either a Array or a Collection. The collection/array items serializer selection follows the same rules a stated before
- otherwise an instance of ToStringSerializer
if no serializer for the given type has been found in the map
The custom properties can customize the default behavior, it may contain values mapped with the following keys:
- CRestProperty.SERIALIZER_CUSTOM_SERIALIZER_MAP
- CRestProperty.SERIALIZER_LIST_SEPARATOR
- CRestProperty.SERIALIZER_DATE_FORMAT
customProperties
- Map of default serializer per Typetype
- Type to get the serializer for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |