String[] path = field.split("\\.");
Field f = encoder.getField(path);
if (f == null)
throw new IllegalArgumentException("No such field " + field + " on class " + type);
Parent parentAnno = f.getAnnotation(Parent.class);
if (parentAnno != null)
{
switch (parentAnno.value())
{
case AncestorQuery :
{
if (gop == FilterOperator.EQUAL)
return ancestor(value);
else
throw new IllegalArgumentException("Cannot filter on parent-key encoded field " + field + " in class " + type + " using " + gop);
}
case NoFilter :
{
throw new IllegalArgumentException("No filtering on FilterPolicy." + parentAnno.value() + " parent relationships.");
}
case RetainKey :
// all good in this case
}
}