Skip navigation links

Package org.apache.juneau.rest.jaxrs

JAX-RS integration components

See: Description

Package org.apache.juneau.rest.jaxrs Description

JAX-RS integration components

Defines an API and default provides for using Juneau serializers and parsers as JAX-RS providers.

Table of Contents
  1. Juneau JAX-RS Provider

1 - Juneau JAX-RS Provider

The Juneau framework contains the org.apache.juneau.rest.jaxrs package for performing simple integration of Juneau serializers and parsers in JAX-RS compliant environments.

It should be noted that although some of the functionality of the Juneau Server API is provided through the JAX-RS integration components, it is not nearly as flexible as using the RestServlet class directly.

What you can do with the Juneau JAX-RS provider classes:

  • Use existing Juneau serializers and parsers for converting streams to POJOs and vis-versa.
  • Use annotations to specify filters and properties using the RestMethod and JuneauProvider annotations.

What you can't do with the Juneau JAX-RS provider classes:

  • Specify or override serializers/parsers at the Java class and method levels.
    JAX-RS does not provide the capability to use different providers for the same media types at the class or method levels.
  • Specify or override filters and properties at the Java class level.
  • Default stylesheets for the HtmlDocSerializer class.
    It will produce HTML, but it won't contain any styles applied.
  • The ability to specify HTTP method, headers, and content using GET parameters.
    These make debugging REST interfaces using only a browser possible.
  • Class or method level encoding.
  • Class or method level guards.
  • Class or method level converters.
Juneau JAX-RS Provider API

The Juneau JAX-RS provider API consists of the following classes:

  • BaseProvider - The base provider class that implements the JAX-RS MessageBodyReader and MessageBodyWriter interfaces.
  • JuneauProvider - Annotation that is applied to subclasses of BaseProvider to specify the serializers/parsers associated with a provider, and optionally filters and properties to apply to those serializers and parsers.
  • DefaultProvider - A default provider that provides the same level of media type support as the RestServletDefault class.

For the most part, when using these components, you'll either use the existing DefaultProvider or JuneauProvider providers, or define your own by subclassing BaseProvider.

Skip navigation links

Copyright © 2017 Apache. All rights reserved.