private static Object serializeQueryCondition(
SerializerProvider serializerProvider, JsonSerializer serializer,
String key, QueryCondition condition) {
if (condition instanceof SimpleQueryCondition) {
SimpleQueryCondition simple = (SimpleQueryCondition) condition;
if (!simple.requiresSerialization() || simple.getValue() == null) {
return simple.getValue();
} else {
if (!key.startsWith("$")) {
serializer = findQuerySerializer(false, key,
serializerProvider, serializer);
}
return serializeQueryField(simple.getValue(), serializer,
serializerProvider, key);
}
} else if (condition instanceof CollectionQueryCondition) {
CollectionQueryCondition coll = (CollectionQueryCondition) condition;
if (!key.startsWith("$")) {