PAK Core – IJsonMapper
1. What you will learn
In this short summary you will get an idea on where and how the IJsonMapper interface is used.
2. Basics
All data which is loaded during the execution of an engine will be tried to be converted to JSON before being delegated to interpreters. The IJsonMapper is responsible for all of those conversions.
3. Signature
Before giving a short example on how the interface should be used, this section describes the signature of the IJsonMapper
interface, as well as an overview on which methods have to be implemented.
|
Converts the given json string into its object representation of the given type. |
|
Analogous to the method above, but takes a java class as the type. |
|
Converts a given bean into a json string. |
|
Resolves the given json path inside the given json. |
|
Checks if the given bean is a JSON String. |
|
Checks the given bean for it’s json type. |
resolvePathIn() should at least support the JSON path syntax defined in the Interpolation Reference
|
4. Usage in the Engine
This section briefly outlines how the IJsonMapper
will be used in the engine.
4.1. Engine Persistence
When the engine tries to store a value to the datastore (store), it will convert the object to the JSON format using toJsonString()
before converting the value to the user scheme in the IDataTransformer