class ParameterResolverFactory {

    public ParameterResolver createParameterResolver(Annotation annotation) {
        final Class annotationType = annotation.annotationType();
        if (annotationType == CookieParam.class) {
            return new CookieParameterResolver((CookieParam)annotation, new TypeProducerFactory());
        }
        if (annotationType == Context.class) {
            return new ContextParameterResolver();
        }
        if (annotationType == FormParam.class) {
            return new FormParameterResolver((FormParam)annotation, new TypeProducerFactory());
        }
        if (annotationType == HeaderParam.class) {
            return new HeaderParameterResolver((HeaderParam)annotation, new TypeProducerFactory());
        }
        if (annotationType == MatrixParam.class) {
            return new MatrixParameterResolver((MatrixParam)annotation, new TypeProducerFactory());
        }
        if (annotationType == PathParam.class) {
            return new PathParameterResolver((PathParam)annotation, new TypeProducerFactory());
        }
        if (annotationType == QueryParam.class) {
            return new QueryParameterResolver((QueryParam)annotation, new TypeProducerFactory());
        }
        if (annotationType == Property.class) {
            return new PropertyResolver((Property)annotation);
        }
        throw new IllegalArgumentException(String.format("Unsupported annotation %s", annotationType));
    }

}