private static void evaluateResourceClass(ClassResourceInfo cri, boolean enableStatic) { MethodDispatcher md = new MethodDispatcher(); Class<?> serviceClass = cri.getServiceClass(); final Set<Method> annotatedMethods = new HashSet<>(); for (Method m : serviceClass.getMethods()) { if (!m.isBridge() && !m.isSynthetic()) { //do real methods first Method annotatedMethod = AnnotationUtils.getAnnotatedMethod(serviceClass, m); if (!annotatedMethods.contains(annotatedMethod)) { evaluateResourceMethod(cri, enableStatic, md, m, annotatedMethod); annotatedMethods.add(annotatedMethod); } } } for (Method m : serviceClass.getMethods()) { if (m.isBridge() || m.isSynthetic()) { //if a bridge/synthetic method isn't already mapped to something, go ahead and do it Method annotatedMethod = AnnotationUtils.getAnnotatedMethod(serviceClass, m); if (!annotatedMethods.contains(annotatedMethod)) { evaluateResourceMethod(cri, enableStatic, md, m, annotatedMethod); annotatedMethods.add(annotatedMethod); } } } cri.setMethodDispatcher(md); }
public ClassResourceInfo(ClassResourceInfo cri) { super(cri.getBus()); if (cri.isCreatedFromModel() && !InjectionUtils.isConcreteClass(cri.getServiceClass())) { this.root = cri.root; this.serviceClass = cri.serviceClass; this.uriTemplate = cri.uriTemplate; this.methodDispatcher = new MethodDispatcher(cri.methodDispatcher, this); this.subResources = cri.subResources; //CHECKSTYLE:OFF this.paramFields = cri.paramFields; this.paramMethods = cri.paramMethods; //CHECKSTYLE:ON this.enableStatic = true; this.nameBindings = cri.nameBindings; this.parent = cri.parent; } else { throw new IllegalArgumentException(); } }
public ClassResourceInfo(ClassResourceInfo cri) { super(cri.getBus()); if (cri.isCreatedFromModel() && !InjectionUtils.isConcreteClass(cri.getServiceClass())) { this.root = cri.root; this.serviceClass = cri.serviceClass; this.uriTemplate = cri.uriTemplate; this.methodDispatcher = new MethodDispatcher(cri.methodDispatcher, this); this.subResources = cri.subResources; //CHECKSTYLE:OFF this.paramFields = cri.paramFields; this.paramMethods = cri.paramMethods; //CHECKSTYLE:ON this.enableStatic = true; this.nameBindings = cri.nameBindings; this.parent = cri.parent; } else { throw new IllegalArgumentException(); } }
cri.setURITemplate(t); MethodDispatcher md = new MethodDispatcher(); Map<String, UserOperation> ops = model.getOperationsAsMap();
URITemplate t = URITemplate.createTemplate(model.getPath()); cri.setURITemplate(t); MethodDispatcher md = new MethodDispatcher(); Map<String, UserOperation> ops = model.getOperationsAsMap(); for (Method m : cri.getServiceClass().getMethods()) {
private static void evaluateResourceClass(ClassResourceInfo cri, boolean enableStatic) { MethodDispatcher md = new MethodDispatcher(); Class<?> serviceClass = cri.getServiceClass(); for (Method m : serviceClass.getMethods()) {