throws IOException {
ObjectNode root = jp.readValueAsTree();
// pass in our objectCodec so that the subJsonParser knows about our configured Modules and Annotations
JsonParser subJsonParser = root.traverse( jp.getCodec() );
// Check if it is a "RealFilter"
JsonNode valueParam = root.get("value");
if ( valueParam == null ) {
return subJsonParser.readValueAs( LogicalFilter4.class );
}
if ( valueParam.isBoolean() ) {
return subJsonParser.readValueAs( BooleanRealFilter4.class );
}
else if ( valueParam.isTextual() ) {
return subJsonParser.readValueAs( StringRealFilter4.class );
}
else if ( valueParam.isIntegralNumber() ) {
return subJsonParser.readValueAs( IntegerRealFilter4.class );
}
else {
throw new RuntimeException("Unknown type");
}
}