Package com.hybris.cockpitng.json.ser
Class PolymorphicSerialization
- java.lang.Object
-
- com.hybris.cockpitng.json.ser.PolymorphicSerialization
-
public final class PolymorphicSerialization extends java.lang.ObjectClass containing all tools and classes needed to serialize and deserialize polymorphic maps
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPolymorphicSerialization.Deserializerstatic classPolymorphicSerialization.Serializer
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TdeserializeCompound(com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.DeserializationContext deserializationContext)Deserializes object from provided JSON node.static <T> TdeserializeCompound(java.lang.Class<T> type, com.fasterxml.jackson.databind.JsonNode arrayNode, int currentIndex, com.fasterxml.jackson.databind.DeserializationContext deserializationContext)Deserializes object of specified type using provided parser.static voidserializeCompound(java.lang.Object o, com.fasterxml.jackson.core.JsonGenerator jsonGenerator)Serializes provided object as a compound type (incl.
-
-
-
Method Detail
-
serializeCompound
public static void serializeCompound(java.lang.Object o, com.fasterxml.jackson.core.JsonGenerator jsonGenerator) throws java.io.IOExceptionSerializes provided object as a compound type (incl. class name).- Parameters:
o- object to be serialized (may benull)jsonGenerator- generator- Throws:
java.io.IOException- thrown when object may not be serialized
-
deserializeCompound
public static <T> T deserializeCompound(com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.DeserializationContext deserializationContext) throws java.io.IOExceptionDeserializes object from provided JSON node. An object may benull,Stringor compound value in format of [class, value].- Type Parameters:
T- type of value to be read- Parameters:
node- JSON node to be interpreteddeserializationContext- context- Returns:
- value read
- Throws:
java.io.IOException- thrown when read is not possible
-
deserializeCompound
public static <T> T deserializeCompound(java.lang.Class<T> type, com.fasterxml.jackson.databind.JsonNode arrayNode, int currentIndex, com.fasterxml.jackson.databind.DeserializationContext deserializationContext) throws java.lang.IllegalAccessException, java.lang.InstantiationException, java.io.IOExceptionDeserializes object of specified type using provided parser. Method assumes that parser is set on first token to be read by method. It end execution leaving parser right after last read token.- Type Parameters:
T- type of value to be read- Parameters:
type- expected type of valuedeserializationContext- context- Returns:
- value read
- Throws:
java.io.IOException- thrown when read is not possiblejava.lang.IllegalAccessExceptionjava.lang.InstantiationException
-
-