ParseRuleSelector startRuleSelector = new ParseRuleSelector() {
public Tree invokeParseRule(EsperEPL2GrammarParser parser) throws RecognitionException {
return parser.startJsonValueRule();
}
};
ParseResult parseResult = ParseHelper.parse(json, json, true, startRuleSelector, false);
EsperEPL2GrammarParser.StartJsonValueRuleContext tree = (EsperEPL2GrammarParser.StartJsonValueRuleContext) parseResult.getTree();
Object parsed = ASTJsonHelper.walk(parseResult.getTokenStream(), tree.jsonvalue());
if (!(parsed instanceof Map)) {
throw new ExprValidationException("Failed to map value to object of type " + topClass.getName() + ", expected Json Map/Object format, received " + (parsed != null ? parsed.getClass().getSimpleName() : "null"));
}
Map<String, Object> objectProperties = (Map<String, Object>) parsed;