class LoggedInUserMethodArgumentResolver implements HandlerMethodArgumentResolver {

    @Override
    public boolean supportsParameter(MethodParameter parameter) {
        if(parameter.hasParameterAnnotation(ModelAttribute.class)) {
            return false;
        }

        Class<?> paramType = parameter.getParameterType();
        return UserResource.class.isAssignableFrom(paramType);
    }

}