blob: 50869d6becb80a4733ec1e0ea81c32bfad8d80ca [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.2) on Wed Sep 23 17:36:24 GMT 2020 -->
<title>Providers (jakarta.ws.rs-api 3.0.0 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2020-09-23">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Providers (jakarta.ws.rs-api 3.0.0 API)";
}
}
catch(err) {
}
//-->
var data = {"i0":6,"i1":6,"i2":6,"i3":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Providers.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">jakarta.ws.rs.ext</a></div>
<h2 title="Interface Providers" class="title">Interface Providers</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre>public interface <span class="typeNameLabel">Providers</span></pre>
<div class="block">An injectable interface providing runtime lookup of provider instances.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.0</dd>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Paul Sandoz, Marc Hadley</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../core/Context.html" title="annotation in jakarta.ws.rs.core"><code>Context</code></a>,
<a href="MessageBodyReader.html" title="interface in jakarta.ws.rs.ext"><code>MessageBodyReader</code></a>,
<a href="MessageBodyWriter.html" title="interface in jakarta.ws.rs.ext"><code>MessageBodyWriter</code></a>,
<a href="ContextResolver.html" title="interface in jakarta.ws.rs.ext"><code>ContextResolver</code></a>,
<a href="ExceptionMapper.html" title="interface in jakarta.ws.rs.ext"><code>ExceptionMapper</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;<a href="ContextResolver.html" title="interface in jakarta.ws.rs.ext">ContextResolver</a>&lt;T&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getContextResolver(java.lang.Class,jakarta.ws.rs.core.MediaType)">getContextResolver</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a>&lt;T&gt;&nbsp;contextType,
<a href="../core/MediaType.html" title="class in jakarta.ws.rs.core">MediaType</a>&nbsp;mediaType)</code></th>
<td class="colLast">
<div class="block">Get a context resolver for a particular type of context and media type.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>&lt;T extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Throwable</a>&gt;<br><a href="ExceptionMapper.html" title="interface in jakarta.ws.rs.ext">ExceptionMapper</a>&lt;T&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getExceptionMapper(java.lang.Class)">getExceptionMapper</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a>&lt;T&gt;&nbsp;type)</code></th>
<td class="colLast">
<div class="block">Get an exception mapping provider for a particular class of exception.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;<a href="MessageBodyReader.html" title="interface in jakarta.ws.rs.ext">MessageBodyReader</a>&lt;T&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMessageBodyReader(java.lang.Class,java.lang.reflect.Type,java.lang.annotation.Annotation%5B%5D,jakarta.ws.rs.core.MediaType)">getMessageBodyReader</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a>&lt;T&gt;&nbsp;type,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Type.html?is-external=true" title="class or interface in java.lang.reflect" class="externalLink">Type</a>&nbsp;genericType,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation" class="externalLink">Annotation</a>[]&nbsp;annotations,
<a href="../core/MediaType.html" title="class in jakarta.ws.rs.core">MediaType</a>&nbsp;mediaType)</code></th>
<td class="colLast">
<div class="block">Get a message body reader that matches a set of criteria.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;<a href="MessageBodyWriter.html" title="interface in jakarta.ws.rs.ext">MessageBodyWriter</a>&lt;T&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMessageBodyWriter(java.lang.Class,java.lang.reflect.Type,java.lang.annotation.Annotation%5B%5D,jakarta.ws.rs.core.MediaType)">getMessageBodyWriter</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a>&lt;T&gt;&nbsp;type,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Type.html?is-external=true" title="class or interface in java.lang.reflect" class="externalLink">Type</a>&nbsp;genericType,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation" class="externalLink">Annotation</a>[]&nbsp;annotations,
<a href="../core/MediaType.html" title="class in jakarta.ws.rs.core">MediaType</a>&nbsp;mediaType)</code></th>
<td class="colLast">
<div class="block">Get a message body writer that matches a set of criteria.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="getMessageBodyReader(java.lang.Class,java.lang.reflect.Type,java.lang.annotation.Annotation[],jakarta.ws.rs.core.MediaType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMessageBodyReader</h4>
<pre class="methodSignature">&lt;T&gt;&nbsp;<a href="MessageBodyReader.html" title="interface in jakarta.ws.rs.ext">MessageBodyReader</a>&lt;T&gt;&nbsp;getMessageBodyReader&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a>&lt;T&gt;&nbsp;type,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Type.html?is-external=true" title="class or interface in java.lang.reflect" class="externalLink">Type</a>&nbsp;genericType,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation" class="externalLink">Annotation</a>[]&nbsp;annotations,
<a href="../core/MediaType.html" title="class in jakarta.ws.rs.core">MediaType</a>&nbsp;mediaType)</pre>
<div class="block">Get a message body reader that matches a set of criteria. The set of readers is first filtered by comparing the
supplied value of <code>mediaType</code> with the value of each reader's <a href="../Consumes.html" title="annotation in jakarta.ws.rs"><code>Consumes</code></a>, ensuring the
supplied value of <code>type</code> is assignable to the generic type of the reader, and eliminating those that do not
match. The list of matching readers is then ordered with those with the best matching values of
<a href="../Consumes.html" title="annotation in jakarta.ws.rs"><code>Consumes</code></a> (x/y &gt; x&#47;* &gt; *&#47;*) sorted first. Finally, the
<a href="MessageBodyReader.html#isReadable(java.lang.Class,java.lang.reflect.Type,java.lang.annotation.Annotation%5B%5D,jakarta.ws.rs.core.MediaType)"><code>MessageBodyReader.isReadable(Class, Type, Annotation[], MediaType)</code></a> method is called on each reader in order
using the supplied criteria and the first reader that returns <code>true</code> is selected and returned.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - type of the the object that is to be read.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>type</code> - the class of the object that is to be read.</dd>
<dd><code>genericType</code> - the type of object to be produced. E.g. if the message body is to be converted into a method
parameter, this will be the formal type of the method parameter as returned by
<code>Class.getGenericParameterTypes</code>.</dd>
<dd><code>annotations</code> - an array of the annotations on the declaration of the artifact that will be initialized with the
produced instance. E.g. if the message body is to be converted into a method parameter, this will be the annotations
on that parameter returned by <code>Class.getParameterAnnotations</code>.</dd>
<dd><code>mediaType</code> - the media type of the data that will be read.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a MessageBodyReader that matches the supplied criteria or <code>null</code> if none is found.</dd>
</dl>
</li>
</ul>
<a id="getMessageBodyWriter(java.lang.Class,java.lang.reflect.Type,java.lang.annotation.Annotation[],jakarta.ws.rs.core.MediaType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMessageBodyWriter</h4>
<pre class="methodSignature">&lt;T&gt;&nbsp;<a href="MessageBodyWriter.html" title="interface in jakarta.ws.rs.ext">MessageBodyWriter</a>&lt;T&gt;&nbsp;getMessageBodyWriter&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a>&lt;T&gt;&nbsp;type,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Type.html?is-external=true" title="class or interface in java.lang.reflect" class="externalLink">Type</a>&nbsp;genericType,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation" class="externalLink">Annotation</a>[]&nbsp;annotations,
<a href="../core/MediaType.html" title="class in jakarta.ws.rs.core">MediaType</a>&nbsp;mediaType)</pre>
<div class="block">Get a message body writer that matches a set of criteria. The set of writers is first filtered by comparing the
supplied value of <code>mediaType</code> with the value of each writer's <a href="../Produces.html" title="annotation in jakarta.ws.rs"><code>Produces</code></a>, ensuring the
supplied value of <code>type</code> is assignable to the generic type of the reader, and eliminating those that do not
match. The list of matching writers is then ordered with those with the best matching values of
<a href="../Produces.html" title="annotation in jakarta.ws.rs"><code>Produces</code></a> (x/y &gt; x&#47;* &gt; *&#47;*) sorted first. Finally, the
<a href="MessageBodyWriter.html#isWriteable(java.lang.Class,java.lang.reflect.Type,java.lang.annotation.Annotation%5B%5D,jakarta.ws.rs.core.MediaType)"><code>MessageBodyWriter.isWriteable(Class, Type, Annotation[], MediaType)</code></a> method is called on each writer in order
using the supplied criteria and the first writer that returns <code>true</code> is selected and returned.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - type of the object that is to be written.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>type</code> - the class of the object that is to be written.</dd>
<dd><code>genericType</code> - the type of object to be written. E.g. if the message body is to be produced from a field, this
will be the declared type of the field as returned by <code>Field.getGenericType</code>.</dd>
<dd><code>annotations</code> - an array of the annotations on the declaration of the artifact that will be written. E.g. if the
message body is to be produced from a field, this will be the annotations on that field returned by
<code>Field.getDeclaredAnnotations</code>.</dd>
<dd><code>mediaType</code> - the media type of the data that will be written.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a MessageBodyReader that matches the supplied criteria or <code>null</code> if none is found.</dd>
</dl>
</li>
</ul>
<a id="getExceptionMapper(java.lang.Class)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getExceptionMapper</h4>
<pre class="methodSignature">&lt;T extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Throwable</a>&gt;&nbsp;<a href="ExceptionMapper.html" title="interface in jakarta.ws.rs.ext">ExceptionMapper</a>&lt;T&gt;&nbsp;getExceptionMapper&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a>&lt;T&gt;&nbsp;type)</pre>
<div class="block">Get an exception mapping provider for a particular class of exception. Returns the provider whose generic type is the
nearest superclass of <code>type</code>.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - type of the exception handled by the exception mapping provider.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>type</code> - the class of exception.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an <a href="ExceptionMapper.html" title="interface in jakarta.ws.rs.ext"><code>ExceptionMapper</code></a> for the supplied type or <code>null</code> if none is found.</dd>
</dl>
</li>
</ul>
<a id="getContextResolver(java.lang.Class,jakarta.ws.rs.core.MediaType)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getContextResolver</h4>
<pre class="methodSignature">&lt;T&gt;&nbsp;<a href="ContextResolver.html" title="interface in jakarta.ws.rs.ext">ContextResolver</a>&lt;T&gt;&nbsp;getContextResolver&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a>&lt;T&gt;&nbsp;contextType,
<a href="../core/MediaType.html" title="class in jakarta.ws.rs.core">MediaType</a>&nbsp;mediaType)</pre>
<div class="block">Get a context resolver for a particular type of context and media type. The set of resolvers is first filtered by
comparing the supplied value of <code>mediaType</code> with the value of each resolver's <a href="../Produces.html" title="annotation in jakarta.ws.rs"><code>Produces</code></a>,
ensuring the generic type of the context resolver is assignable to the supplied value of <code>contextType</code>, and
eliminating those that do not match. If only one resolver matches the criteria then it is returned. If more than one
resolver matches then the list of matching resolvers is ordered with those with the best matching values of
<a href="../Produces.html" title="annotation in jakarta.ws.rs"><code>Produces</code></a> (x/y &gt; x&#47;* &gt; *&#47;*) sorted first. A proxy is returned that delegates calls
to <a href="ContextResolver.html#getContext(java.lang.Class)"><code>ContextResolver.getContext(java.lang.Class)</code></a> to each matching context resolver in order and returns the
first non-null value it obtains or null if all matching context resolvers return null.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - type of the context.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>contextType</code> - the class of context desired.</dd>
<dd><code>mediaType</code> - the media type of data for which a context is required.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a matching context resolver instance or <code>null</code> if no matching context providers are found.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Providers.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small><p align="left">Copyright &#169; 2018, 2020 Eclipse Foundation.<br>Use is subject to <a href="../../../../resources/EFSL.html" target="_top">license terms</a>.</small></p>
</footer>
</body>
</html>