Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-17731

Improve the JAX-RS ParamConverterProvider validation

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • 4.30.x
    • 4.2.0.Beta2
    • webservices

      The tooling could analyze a bit more the code for the ParamConverterProvider and find all nested/related ParamConverter types and retrieve the Parameter Type to see what "param bean" is supported by the ParamConverter.

      Eg:

      @Provider
      public class Converter implements ParamConverterProvider {
      
      	private ParamConverter<Car> carConverter = new ParamConverter<Car>() {
      
      		@Override
      		public Car fromString(String arg0) {
      			Car car = new Car();
      			car.setBrand(arg0);
      			return car;
      		}
      
      		@Override
      		public String toString(Car arg0) {
      			return arg0.getBrand();
      		}
      
      	};
      	@Override
      	public <T> ParamConverter<T> getConverter(Class<T> arg0, Type arg1,
      			Annotation[] arg2) {
      		if(arg0.equals(Car.class)) {
      			return (ParamConverter<T>) carConverter;
      		}
      		return null;
      	}
      
      }
      

      The tooling should retrieve the anonymous ParamConverter<Car>
      It should also work when the param converter is in its own class.

            Unassigned Unassigned
            xcoulon@redhat.com Xavier Coulon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: