public ControllerRelProvider(Class<?> controller, PluginRegistry<RelProvider, Class<?>> providers) { Assert.notNull(controller, "Controller must not be null!"); ExposesResourceFor annotation = AnnotationUtils.findAnnotation(controller, ExposesResourceFor.class); Assert.notNull(annotation, "Controller must be annotated with ExposesResourceFor!"); this.controllerType = controller; this.entityType = annotation.value(); this.providers = providers; }
private void registerControllerClass(Class<?> controllerType) { Assert.notNull(controllerType, "Controller type must nor be null!"); ExposesResourceFor annotation = AnnotationUtils.findAnnotation(controllerType, ExposesResourceFor.class); if (annotation != null) { entityToController.put(annotation.value(), controllerType); } else { throw new IllegalArgumentException(String.format("Controller %s must be annotated with @ExposesResourceFor!", controllerType.getName())); } }
public ControllerRelProvider(Class<?> controller, PluginRegistry<RelProvider, Class<?>> providers) { Assert.notNull(controller, "Controller must not be null!"); ExposesResourceFor annotation = AnnotationUtils.findAnnotation(controller, ExposesResourceFor.class); Assert.notNull(annotation, "Controller must be annotated with ExposesResourceFor!"); this.controllerType = controller; this.entityType = annotation.value(); this.providers = providers; }
private void registerControllerClass(Class<?> controllerType) { Assert.notNull(controllerType, "Controller type must nor be null!"); ExposesResourceFor annotation = AnnotationUtils.findAnnotation(controllerType, ExposesResourceFor.class); if (annotation != null) { entityToController.put(annotation.value(), controllerType); } else { throw new IllegalArgumentException(String.format("Controller %s must be annotated with @ExposesResourceFor!", controllerType.getName())); } }