com.apama.json
Event JSONPlugin


Convert EPL objects to and from JSON.

Parse JSON to 'any' objects, and 'any' EPL objects to JSON strings.
Since:
10.3

Action summary
 anystatic fromJSON(string json)

Convert a JSON string representation into an EPL value.
 stringstatic toJSON(any value)

Convert an EPL value into a JSON string.
 
Action detail

fromJSON

any static fromJSON(string json)
Convert a JSON string representation into an EPL value.
Parameters:
json - The JSON string form.
Returns:
An EPL value of type any. This may contain a string, integer, float, boolean, sequence<any> or dictionary<any, any>.

The returned value never contains any decimal or Apama event values, as these are not represented in JSON.
Throws:
If the JSON string cannot be parsed.

toJSON

string static toJSON(any value)
Convert an EPL value into a JSON string.
Parameters:
value - The value to convert to JSON. Can be a string, integer, float, decimal, boolean, sequence, dictionary or event.

Note that JSON values are not always round-trippable back to EPL as some aspects of EPL types have no representation in JSON:

Returns:
A JSON string
Throws:
If an unsupported type is specified.