Interface | Description |
---|---|
PersistenceService |
A service to provide persistence and retrieval of context server entities.
|
Class | Description |
---|---|
CustomObjectMapper |
Custom object mapper to be able to configure Jackson to our needs.
|
ItemDeserializer | |
PropertyHelper |
Helper method for properties
|
PropertyTypedObjectDeserializer |
This Jackson deserializer makes it possible to register field matching
regular expressions that can be matched to class names, as in the following
example:
SimpleModule deserializerModule =
new SimpleModule("PropertyTypedObjectDeserializerModule",
new Version(1, 0, 0, null, "org.apache.unomi.rest", "deserializer"));
PropertyTypedObjectDeserializer propertyTypedObjectDeserializer = new PropertyTypedObjectDeserializer(null, null);
propertyTypedObjectDeserializer.registerMapping("type=.*Condition", Condition.class);
deserializerModule.addDeserializer(Object.class, propertyTypedObjectDeserializer);
objectMapper.registerModule(deserializerModule);
In this example any JSON object that has a "type" property that matches the
".*Condition" regular expression will be parsed and mapped to a Condition class
Note that there exists a way to map properties as type identifiers in Jackson,
but this feature is very limited and requires hardcoding possible values.
|
Copyright © 2014–2023 Apache Software Foundation. All rights reserved.