Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-16329 Support JAX-RS 2.0
  3. JBIDE-17391

Provide JAX-RS Resource fields type validation

XMLWordPrintable

      From JAX-RS 1.1 spec (chap 3.2):

      1. Primitive types.
      2. Types that have a constructor that accepts a single String argument.
      3. Types that have a static method named valueOf or fromString with a single String argument that return an instance of the type. If both methods are present then valueOf MUST be used unless the type is an enum in which case fromString MUST be used.
      4. List<T>, Set<T>, or SortedSet<T>, where T satisfies 2 or 3 above.

      JAX-RS 2.0 introduced the notion of ParamConverterProvider:

      Valid parameter types for each of the above annotations are listed in the corresponding Javadoc, however in general (excluding @Context) the following types are supported:
      1. Types for which a ParamConverter is available via a registered ParamConverterProvider. See Javadoc for these classes for more information.
      2. Primitive types.
      3. Types that have a constructor that accepts a single String argument.
      4. Types that have a static method named valueOf or fromString with a single String argument that return an instance of the type. If both methods are present then valueOf MUST be used unless the type is an enum in which case fromString MUST be used1.
      5. List<T>, Set<T>, or SortedSet<T>, where T satisfies 3 or 4 above.

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

              Created:
              Updated:
              Resolved: