blob: c699667a880c4a21a7555756e3a8e66ce25a2814 [file] [log] [blame]
<!DOCTYPE HTML>
<!--
/***************************************************************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
***************************************************************************************************************************/
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
/* For viewing in Page Designer */
@IMPORT url("../../../../../javadoc.css");
/* For viewing in REST interface */
@IMPORT url("../htdocs/javadoc.css");
body {
margin: 20px;
}
</style>
<script>
/* Replace all @code and @link tags. */
window.onload = function() {
document.body.innerHTML = document.body.innerHTML.replace(/\{\@code ([^\}]+)\}/g, '<code>$1</code>');
document.body.innerHTML = document.body.innerHTML.replace(/\{\@link (([^\}]+)\.)?([^\.\}]+)\}/g, '<code>$3</code>');
}
</script>
</head>
<body>
<p>JAX-RS integration components</p>
<script>
function toggle(x) {
var div = x.nextSibling;
while (div != null && div.nodeType != 1)
div = div.nextSibling;
if (div != null) {
var d = div.style.display;
if (d == 'block' || d == '') {
div.style.display = 'none';
x.className += " closed";
} else {
div.style.display = 'block';
x.className = x.className.replace(/(?:^|\s)closed(?!\S)/g , '' );
}
}
}
</script>
<p>
Defines an API and default provides for using Juneau serializers and parsers as JAX-RS providers.
</p>
<a id='TOC'></a><h5 class='toc'>Table of Contents</h5>
<ol class='toc'>
<li><p><a class='doclink' href='#BaseProvider'>Juneau JAX-RS Provider</a></p>
</ol>
<!-- ======================================================================================================== -->
<a id="BaseProvider"></a>
<h2 class='topic' onclick='toggle(this)'>1 - Juneau JAX-RS Provider</h2>
<div class='topic'>
<p>
The Juneau framework contains the <code>org.apache.juneau.rest.jaxrs</code> package for performing simple
integration of Juneau serializers and parsers in JAX-RS compliant environments.
</p>
<p>
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 {@link org.apache.juneau.rest.RestServlet} class directly.
</p>
<p>
What you can do with the Juneau JAX-RS provider classes:
</p>
<ul class='spaced-list'>
<li>
Use existing Juneau serializers and parsers for converting streams to POJOs and vis-versa.
<li>
Use annotations to specify filters and properties using the {@link org.apache.juneau.rest.annotation.RestMethod}
and {@link org.apache.juneau.rest.jaxrs.JuneauProvider} annotations.
</ul>
<p>
What you can't do with the Juneau JAX-RS provider classes:
</p>
<ul class='spaced-list'>
<li>
Specify or override serializers/parsers at the Java class and method levels.
<br>JAX-RS does not provide the capability to use different providers for the same media types
at the class or method levels.
<li>
Specify or override filters and properties at the Java class level.
<li>
Default stylesheets for the {@link org.apache.juneau.html.HtmlDocSerializer} class.
<br>It will produce HTML, but it won't contain any styles applied.
<li>
The ability to specify HTTP method, headers, and content using GET parameters.
<br>These make debugging REST interfaces using only a browser possible.
<li>
Class or method level encoding.
<li>
Class or method level guards.
<li>
Class or method level converters.
</ul>
<h6 class='topic'>Juneau JAX-RS Provider API</h6>
<p>
The Juneau JAX-RS provider API consists of the following classes:
</p>
<ul class='spaced-list'>
<li>
{@link org.apache.juneau.rest.jaxrs.BaseProvider} - The base provider class that implements the JAX-RS
<code>MessageBodyReader</code> and <code>MessageBodyWriter</code> interfaces.
<li>
{@link org.apache.juneau.rest.jaxrs.JuneauProvider} - Annotation that is applied to subclasses of <code>BaseProvider</code>
to specify the serializers/parsers associated with a provider, and optionally filters and properties to
apply to those serializers and parsers.
<li>
{@link org.apache.juneau.rest.jaxrs.DefaultProvider} - A default provider that provides the same level
of media type support as the {@link org.apache.juneau.rest.RestServletDefault} class.
</ul>
<p>
For the most part, when using these components, you'll either use the existing <code>DefaultProvider</code> or
<code>JuneauProvider</code> providers, or define your own by subclassing <code>BaseProvider</code>.
</p>
</div>
</body>
</html>