public String consumeFilter(String methodString, String consumableText, Map<String, String> fieldNames,DynamicFinderMethodResolver created) {
boolean found = false;
for(Map.Entry<String, String> fieldEntry: fieldNames.entrySet()) {
if(consumableText.startsWith(fieldEntry.getKey())) {
consumableText = consumableText.substring(fieldEntry.getKey().length());
FieldInformer informer = backEnd.getInformer().get(fieldEntry.getValue());
Map<String, Method> queries = Utils.getUppercasedMap(informer.getClass().getMethods());
found = false;
for(Map.Entry<String, Method> methodEntry : queries.entrySet()) {
if(consumableText.startsWith(methodEntry.getKey())) {
consumableText = consumableText.substring(methodEntry.getKey().length());
created.addQueryExpression(informer, methodEntry.getValue());
found = true;
}
}
// TODO insert here code for call chaining
if(!found) {
throw new UnableToBuildDueToMissingQueryExpressionException(consumableText, methodString, fieldEntry.getKey(),
Utils.getUppercasedMap(Utils.removeGaedoInternalMethodsFrom(informer.getClass().getMethods())).keySet());
}
for(Combinator c: Combinator.values()) {
if(consumableText.startsWith(c.getText())) {
consumableText = consumableText.substring(c.getText().length());
created.setCombinator(c);