root.addExpression(expression); return expression; root.addExpression(expression); return expression; if (tmp == null) tmp = new SegmentNode(segment); node.children.put(segment, tmp); node.addExpression(exp); if (tmp == null) tmp = new SegmentNode(segment); node.children.put(segment, tmp); node.addExpression(exp); node.addExpression(exp);
return match(matches, "GET", request); for (MediaType consume : consumes) consumeCombo.add(createSortFactor(contentType, consume)); SortFactor sortFactor = createSortFactor(accept, produce); String[] mm = matchingMethods(sortList); if (mm != null) LogMessages.LOGGER.multipleMethodsMatch(requestToString(request), mm);
public void potentials(String path, int start, List<MethodExpression> matches) { if (start == path.length()) // we've reached end of string { matches.addAll(targets); return; } if (start < path.length()) { String simpleSegment = null; int endOfSegmentIndex = path.indexOf('/', start); if (endOfSegmentIndex > -1) simpleSegment = path.substring(start, endOfSegmentIndex); else simpleSegment = path.substring(start); SegmentNode child = children.get(simpleSegment); if (child != null) { int next = start + simpleSegment.length(); if (endOfSegmentIndex > -1) next++; // go past '/' child.potentials(path, next, matches); } } for (MethodExpression exp : targets) { // skip any static matches as they will not match anyways if (exp.getNumGroups() > 0 || exp.getInvoker() instanceof ResourceLocatorInvoker) { matches.add(exp); } } }
potentials(path, start, potentials); Collections.sort(potentials); Match match = match(matches, request.getHttpMethod(), request); match.expression.populatePathParams(request, match.matcher, path); logger.log("MATCH_PATH_SELECTED", match.expression.getRegex());
public ResourceInvoker match(HttpRequest request, int start) { return root.match(request, start); }
if (start < path.length() && path.charAt(start) == '/') start++; List<MethodExpression> potentials = new ArrayList<MethodExpression>(); potentials(path, start, potentials); Collections.sort(potentials); Match match = match(matches, request.getHttpMethod(), request); match.expression.populatePathParams(request, match.matcher, path); return match.expression.getInvoker();
public ResourceInvoker match(HttpRequest request, int start) { return root.match(request, start); }
return match(matches, "GET", request); for (MediaType consume : consumes) consumeCombo.add(createSortFactor(contentType, consume)); SortFactor sortFactor = createSortFactor(accept, produce); String[] mm = matchingMethods(sortList); if (mm != null) LogMessages.LOGGER.multipleMethodsMatch(requestToString(request), mm);
potentials(path, start, potentials); Collections.sort(potentials); Match match = match(matches, request.getHttpMethod(), request); match.expression.populatePathParams(request, match.matcher, path); logger.log("MATCH_PATH_SELECTED", match.expression.getRegex());
root.addExpression(expression); return expression; root.addExpression(expression); return expression; if (tmp == null) tmp = new SegmentNode(segment); node.children.put(segment, tmp); node.addExpression(exp); if (tmp == null) tmp = new SegmentNode(segment); node.children.put(segment, tmp); node.addExpression(exp); node.addExpression(exp);
public ResourceInvoker match(HttpRequest request, int start) { return root.match(request, start); }
public void potentials(String path, int start, List<MethodExpression> matches) { if (start == path.length()) // we've reached end of string { matches.addAll(targets); return; } if (start < path.length()) { String simpleSegment = null; int endOfSegmentIndex = path.indexOf('/', start); if (endOfSegmentIndex > -1) simpleSegment = path.substring(start, endOfSegmentIndex); else simpleSegment = path.substring(start); SegmentNode child = children.get(simpleSegment); if (child != null) { int next = start + simpleSegment.length(); if (endOfSegmentIndex > -1) next++; // go past '/' child.potentials(path, next, matches); } } for (MethodExpression exp : targets) { // skip any static matches as they will not match anyways if (exp.getNumGroups() > 0 || exp.getInvoker() instanceof ResourceLocatorInvoker) { matches.add(exp); } } }
return match(matches, "GET", request); for (MediaType consume : consumes) consumeCombo.add(createSortFactor(contentType, consume)); SortFactor sortFactor = createSortFactor(accept, produce); String[] mm = matchingMethods(sortList); if (mm != null) LogMessages.LOGGER.multipleMethodsMatch(requestToString(request), mm);
root.addExpression(expression); return expression; root.addExpression(expression); return expression; if (tmp == null) tmp = new SegmentNode(segment); node.children.put(segment, tmp); node.addExpression(exp); if (tmp == null) tmp = new SegmentNode(segment); node.children.put(segment, tmp); node.addExpression(exp); node.addExpression(exp);
public void potentials(String path, int start, List<MethodExpression> matches) { if (start == path.length()) // we've reached end of string { matches.addAll(targets); return; } if (start < path.length()) { String simpleSegment = null; int endOfSegmentIndex = path.indexOf('/', start); if (endOfSegmentIndex > -1) simpleSegment = path.substring(start, endOfSegmentIndex); else simpleSegment = path.substring(start); SegmentNode child = children.get(simpleSegment); if (child != null) { int next = start + simpleSegment.length(); if (endOfSegmentIndex > -1) next++; // go past '/' child.potentials(path, next, matches); } } for (MethodExpression exp : targets) { // skip any static matches as they will not match anyways if (exp.getNumGroups() > 0 || exp.getInvoker() instanceof ResourceLocatorInvoker) { matches.add(exp); } } }