Object result = jsonObject;
boolean inArrayContext = false;
for (PathToken pathToken : tokenizer) {
PathTokenFilter filter = pathToken.getFilter();
if(LOG.isDebugEnabled()){
LOG.debug("Applying filter: " + filter + " to " + result);
}
result = filter.filter(result, configuration, contextFilters, inArrayContext);
if(result == null && !pathToken.isEndToken()){
throw new PathNotFoundException("Path token: '" + pathToken.getFragment() + "' not found.");
}
if (!inArrayContext) {
inArrayContext = filter.isArrayFilter();
}
}
return (T) result;
}