private ResObjAndRemPath obtainObject(
RroRemPathAndMatchedPath rroRemPathAndMatchedPath)
throws WebApplicationException, RequestHandledException {
ResourceObject o = rroRemPathAndMatchedPath.rootResObj;
RemainingPath u = rroRemPathAndMatchedPath.u;
ResourceClass resClass = o.getResourceClass();
CallContext callContext = tlContext.get();
callContext.addForMatched(o.getJaxRsResourceObject(),
rroRemPathAndMatchedPath.matchedUriPath);
// Part 2
for (;;) // (j)
{
// (a) If U is null or '/' go to step 3
if (u.isEmptyOrSlash()) {
return new ResObjAndRemPath(o, u);
}
// (b) Set C = class ofO,E = {}
Collection<ResourceMethodOrLocator> eWithMethod = new ArrayList<ResourceMethodOrLocator>();
// (c) and (d) Filter E: remove members do not match U or final
// match not empty
for (ResourceMethodOrLocator methodOrLocator : resClass
.getResourceMethodsAndLocators()) {
PathRegExp pathRegExp = methodOrLocator.getPathRegExp();
MatchingResult matchingResult = pathRegExp.match(u);
if (matchingResult == null)
continue;