@Override
public LogicalOperator deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException,
JsonProcessingException {
ObjectIdGenerator<Integer> idGenerator = new ObjectIdGenerators.IntSequenceGenerator();
JsonLocation start = jp.getCurrentLocation();
JsonToken t = jp.getCurrentToken();
LogicalOperator parent = null;
LogicalOperator first = null;
LogicalOperator prev = null;
Integer id = null;
while (true) {
String fieldName = jp.getText();
t = jp.nextToken();
switch (fieldName) { // switch on field names.
case "@id":
id = _parseIntPrimitive(jp, ctxt);
break;
case "input":
JavaType tp = ctxt.constructType(LogicalOperator.class);
JsonDeserializer<Object> d = ctxt.findRootValueDeserializer(tp);
parent = (LogicalOperator) d.deserialize(jp, ctxt);
break;
case "do":
if (!jp.isExpectedStartArrayToken()) {
throwE(
jp,
"The do parameter of sequence should be an array of SimpleOperators. Expected a JsonToken.START_ARRAY token but received a "
+ t.name() + "token.");
}
int pos = 0;
while ((t = jp.nextToken()) != JsonToken.END_ARRAY) {
// logger.debug("Reading sequence child {}.", pos);
JsonLocation l = jp.getCurrentLocation(); // get current location
// first so we can
// correctly reference the
// start of the object in
// the case that the type
// is wrong.