public MultivaluedMap<String, ResourceInvoker> getBounded() { MultivaluedHashMap<String, ResourceInvoker> rtn = new MultivaluedHashMap<String, ResourceInvoker>(); for (Map.Entry<String, List<MethodExpression>> entry : bounded.entrySet()) { for (MethodExpression exp : entry.getValue()) { rtn.add(entry.getKey(), exp.getInvoker()); } } return rtn; }
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); } } }
SortEntry a; SortEntry b = it.next(); Method first = b.match.expression.getInvoker().getMethod(); while (it.hasNext()) s.add(first); s.add(b.match.expression.getInvoker().getMethod());
public void removeBinding(String path, Method method) { List<MethodExpression> expressions = bounded.get(path); if (expressions == null) return; for (MethodExpression expression : expressions) { ResourceInvoker invoker = expression.getInvoker(); if (invoker.getMethod().equals(method)) { expression.parent.targets.remove(expression); expressions.remove(expression); if (expressions.size() == 0) bounded.remove(path); size--; if (invoker instanceof ResourceMethodInvoker) { ((ResourceMethodInvoker)invoker).cleanup(); } return; } } }
ResourceMethodInvoker invoker = (ResourceMethodInvoker) match.expression.getInvoker(); if (invoker.getHttpMethods().contains(httpMethod.toUpperCase())) for (Match match : matches) allowed.addAll(((ResourceMethodInvoker) match.expression.getInvoker()).getHttpMethods()); for (Match match : matches) if (((ResourceMethodInvoker) match.expression.getInvoker()).getHttpMethods().contains("PATCH")) patchAccepts.addAll(Arrays.asList(((ResourceMethodInvoker) match.expression.getInvoker()) .getConsumes())); for (Match match : list) ResourceMethodInvoker invoker = (ResourceMethodInvoker) match.expression.getInvoker(); if (contentType == null) contentType = MediaType.WILDCARD_TYPE; final Method m = match.expression.getInvoker().getMethod(); sortList.add(new SortEntry(match, consume, sortFactor, produce));
ResourceInvoker invoker = expression.getInvoker(); if (invoker instanceof ResourceLocatorInvoker) match.expression.populatePathParams(request, match.matcher, path); logger.log("MATCH_PATH_SELECTED", match.expression.getRegex()); return match.expression.getInvoker();
public MultivaluedMap<String, ResourceInvoker> getBounded() { MultivaluedHashMap<String, ResourceInvoker> rtn = new MultivaluedHashMap<String, ResourceInvoker>(); for (Map.Entry<String, List<MethodExpression>> entry : bounded.entrySet()) { for (MethodExpression exp : entry.getValue()) { rtn.add(entry.getKey(), exp.getInvoker()); } } return rtn; }
public MultivaluedMap<String, ResourceInvoker> getBounded() { MultivaluedHashMap<String, ResourceInvoker> rtn = new MultivaluedHashMap<String, ResourceInvoker>(); for (Map.Entry<String, List<MethodExpression>> entry : bounded.entrySet()) { for (MethodExpression exp : entry.getValue()) { rtn.add(entry.getKey(), exp.getInvoker()); } } return rtn; }
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); } } }
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); } } }
SortEntry a; SortEntry b = it.next(); Method first = b.match.expression.getInvoker().getMethod(); while (it.hasNext()) s.add(first); s.add(b.match.expression.getInvoker().getMethod());
SortEntry a; SortEntry b = it.next(); Method first = b.match.expression.getInvoker().getMethod(); while (it.hasNext()) s.add(first); s.add(b.match.expression.getInvoker().getMethod());
public void removeBinding(String path, Method method) { List<MethodExpression> expressions = bounded.get(path); if (expressions == null) return; for (MethodExpression expression : expressions) { ResourceInvoker invoker = expression.getInvoker(); if (invoker.getMethod().equals(method)) { expression.parent.targets.remove(expression); expressions.remove(expression); if (expressions.size() == 0) bounded.remove(path); size--; if (invoker instanceof ResourceMethodInvoker) { ((ResourceMethodInvoker)invoker).cleanup(); } return; } } }
public void removeBinding(String path, Method method) { List<MethodExpression> expressions = bounded.get(path); if (expressions == null) return; for (MethodExpression expression : expressions) { ResourceInvoker invoker = expression.getInvoker(); if (invoker.getMethod().equals(method)) { expression.parent.targets.remove(expression); expressions.remove(expression); if (expressions.size() == 0) bounded.remove(path); size--; if (invoker instanceof ResourceMethodInvoker) { ((ResourceMethodInvoker)invoker).cleanup(); } return; } } }
ResourceMethodInvoker invoker = (ResourceMethodInvoker) match.expression.getInvoker(); if (invoker.getHttpMethods().contains(httpMethod.toUpperCase())) for (Match match : matches) allowed.addAll(((ResourceMethodInvoker) match.expression.getInvoker()).getHttpMethods()); for (Match match : matches) if (((ResourceMethodInvoker) match.expression.getInvoker()).getHttpMethods().contains("PATCH")) patchAccepts.addAll(Arrays.asList(((ResourceMethodInvoker) match.expression.getInvoker()) .getConsumes())); for (Match match : list) ResourceMethodInvoker invoker = (ResourceMethodInvoker) match.expression.getInvoker(); if (contentType == null) contentType = MediaType.WILDCARD_TYPE; final Method m = match.expression.getInvoker().getMethod(); sortList.add(new SortEntry(match, consume, sortFactor, produce));
ResourceMethodInvoker invoker = (ResourceMethodInvoker) match.expression.getInvoker(); if (invoker.getHttpMethods().contains(httpMethod.toUpperCase())) for (Match match : matches) allowed.addAll(((ResourceMethodInvoker) match.expression.getInvoker()).getHttpMethods()); for (Match match : matches) if (((ResourceMethodInvoker) match.expression.getInvoker()).getHttpMethods().contains("PATCH")) patchAccepts.addAll(Arrays.asList(((ResourceMethodInvoker) match.expression.getInvoker()) .getConsumes())); for (Match match : list) ResourceMethodInvoker invoker = (ResourceMethodInvoker) match.expression.getInvoker(); if (contentType == null) contentType = MediaType.WILDCARD_TYPE; final Method m = match.expression.getInvoker().getMethod(); sortList.add(new SortEntry(match, consume, sortFactor, produce));
ResourceInvoker invoker = expression.getInvoker(); if (invoker instanceof ResourceLocatorInvoker) return match.expression.getInvoker();
ResourceInvoker invoker = expression.getInvoker(); if (invoker instanceof ResourceLocatorInvoker) match.expression.populatePathParams(request, match.matcher, path); logger.log("MATCH_PATH_SELECTED", match.expression.getRegex()); return match.expression.getInvoker();