private PathPattern getPattern(String path, Class c) { PathPattern p = null; try { p = new PathPattern(new PathTemplate(path)); } catch (IllegalArgumentException ex) { Errors.error("Illegal URI template for root resource class " + c.getName() + ": "+ ex.getMessage()); } return p; }
public void onConflict(PathPattern p1, PathPattern p2) { Errors.error(String.format("Conflicting URI templates. " + "The URI templates %s and %s for root resource classes " + "transform to the same regular expression %s", p1.getTemplate().getTemplate(), p2.getTemplate().getTemplate(), p1)); } });
public void onConflict(PathPattern p1, PathPattern p2) { Errors.error(String.format("Conflicting URI templates. " + "The URI templates %s and %s for sub-resource methods " + "and/or sub-resource locators of resource class %s " + "transform to the same regular expression %s", p1.getTemplate().getTemplate(), p2.getTemplate().getTemplate(), resource.getResourceClass().getName(), p1)); } });
private boolean isPatternValid(PathPattern p, Class c) { if (p == null) return false; final PathPattern conflict = rules.hasConflict(p); if (conflict != null) { Errors.error(String.format("Conflicting URI templates. " + "The URI template %s for root resource class %s " + "and the URI template %s transform to the same regular expression %s", p.getTemplate().getTemplate(), c.getName(), conflict.getTemplate().getTemplate(), p)); return false; } else { return true; } }
scope = annotationType; } else if (rf != null && providerFactoryClass != null) { Errors.error("Class " + c.getName() + " is annotated with multiple scopes: " + scope.getName() + " and " + annotationType.getName());
private boolean isValidResourceMethod( final ResourceMethod rm, final ResourceMethodMap rmm) { final List<ResourceMethod> rml = rmm.get(rm.getHttpMethod()); if (rml != null) { boolean conflict = false; ResourceMethod erm = null; for (int i = 0; i < rml.size() && !conflict; i++) { erm = rml.get(i); conflict = MediaTypes.intersects(rm.getConsumes(), erm.getConsumes()) && MediaTypes.intersects(rm.getProduces(), erm.getProduces()); } if (conflict) { if (rm.getAbstractResourceMethod().hasEntity()) { Errors.error(String.format("Consuming media type conflict. " + "The resource methods %s and %s can consume the same media type", rm.getAbstractResourceMethod().getMethod(), erm.getAbstractResourceMethod().getMethod())); } else { Errors.error(String.format("Producing media type conflict. " + "The resource methods %s and %s can produce the same media type", rm.getAbstractResourceMethod().getMethod(), erm.getAbstractResourceMethod().getMethod())); } } if (conflict) return false; } return true; }
private ResourceUriRules newResourceUriRules(final AbstractResource ar) { assert null != ar; BasicValidator validator = new BasicValidator(); validator.validate(ar); for (ResourceModelIssue issue : validator.getIssueList()) { Errors.error(issue.getMessage(), issue.isFatal()); } return new ResourceUriRules( resourceConfig, getDispatchProvider(), injectableFactory, filterFactory, wadlFactory, dispatchingListener, ar); }
p = new PathPattern(new PathTemplate(method.getPath().getValue()), "(/)?"); } catch (IllegalArgumentException ex) { Errors.error(String.format("Illegal URI template for sub-resource method %s: %s", method.getMethod(), ex.getMessage())); continue;
public ResourceHttpMethod( ResourceMethodDispatchProvider dp, FilterFactory ff, List<ResourceFilter> resourceFilters, UriTemplate template, AbstractResourceMethod arm) { super(arm.getHttpMethod(), template, arm.getSupportedInputTypes(), arm.getSupportedOutputTypes(), arm.areOutputTypesDeclared(), dp.create(arm), FilterFactory.getRequestFilters(resourceFilters), FilterFactory.getResponseFilters(resourceFilters)); this.arm = arm; if (getDispatcher() == null) { Method m = arm.getMethod(); String msg = ImplMessages.NOT_VALID_HTTPMETHOD(m, arm.getHttpMethod(), m.getDeclaringClass()); Errors.error(msg); } }
p = new PathPattern(new PathTemplate(locator.getPath().getValue())); } catch (IllegalArgumentException ex) { Errors.error(String.format("Illegal URI template for sub-resource locator %s: %s", locator.getMethod(), ex.getMessage())); continue; Errors.error(String.format("Conflicting URI templates. " + "The URI template %s for sub-resource locator %s " + "and the URI template %s transform to the same regular expression %s",
public static void missingDependency(Method m, int i) { if (getReportMissingDependentFieldOrMethod()) { error("Missing dependency for method " + m + " at parameter at index " + i); } } }
private PathPattern getPattern(String path, Class c) { PathPattern p = null; try { p = new PathPattern(new PathTemplate(path)); } catch (IllegalArgumentException ex) { Errors.error("Illegal URI template for root resource class " + c.getName() + ": "+ ex.getMessage()); } return p; }
public static void missingDependency(Field f) { if (getReportMissingDependentFieldOrMethod()) { error("Missing dependency for field: " + f.toGenericString()); } }
@Override public T create(CreationalContext<T> creationalContext) { Injectable<T> injectable = lookupWebApplication().getServerInjectableProviderFactory(). getInjectable(qualifier.annotationType(), null, qualifier, getBeanClass(), ComponentScope.Singleton); if (injectable == null) { Errors.error("No injectable for " + getBeanClass().getName()); return null; } return injectable.getValue(); } }
public void onConflict(PathPattern p1, PathPattern p2) { Errors.error(String.format("Conflicting URI templates. " + "The URI templates %s and %s for root resource classes " + "transform to the same regular expression %s", p1.getTemplate().getTemplate(), p2.getTemplate().getTemplate(), p1)); } });
public void onConflict(PathPattern p1, PathPattern p2) { Errors.error(String.format("Conflicting URI templates. " + "The URI templates %s and %s for sub-resource methods " + "and/or sub-resource locators of resource class %s " + "transform to the same regular expression %s", p1.getTemplate().getTemplate(), p2.getTemplate().getTemplate(), resource.getResourceClass().getName(), p1)); } });
@Override public T create(CreationalContext<T> creationalContext) { Injectable<T> injectable = lookupWebApplication().getServerInjectableProviderFactory(). getInjectable(qualifier.annotationType(), null, qualifier, getBeanClass(), ComponentScope.Singleton); if (injectable == null) { Errors.error("No injectable for " + getBeanClass().getName()); return null; } return injectable.getValue(); } }
@Override public T create(CreationalContext<T> creationalContext) { Injectable<T> injectable = lookupWebApplication().getServerInjectableProviderFactory(). getInjectable(qualifier.annotationType(), null, qualifier, getBeanClass(), ComponentScope.Singleton); if (injectable == null) { Errors.error("No injectable for " + getBeanClass().getName()); return null; } return injectable.getValue(); } }
public void onConflict(PathPattern p1, PathPattern p2) { Errors.error(String.format("Conflicting URI templates. " + "The URI templates %s and %s for root resource classes " + "transform to the same regular expression %s", p1.getTemplate().getTemplate(), p2.getTemplate().getTemplate(), p1)); } });
public void onConflict(PathPattern p1, PathPattern p2) { Errors.error(String.format("Conflicting URI templates. " + "The URI templates %s and %s for sub-resource methods " + "and/or sub-resource locators of resource class %s " + "transform to the same regular expression %s", p1.getTemplate().getTemplate(), p2.getTemplate().getTemplate(), resource.getResourceClass().getName(), p1)); } });