| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (12) on Mon Aug 12 13:20:58 GMT 2019 --> |
| <title>Providers (jakarta.ws.rs-api 2.1.6 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2019-08-12"> |
| <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 2.1.6 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"> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <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> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </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> <a href="package-summary.html">javax.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 javax.ws.rs.core"><code>Context</code></a>, |
| <a href="MessageBodyReader.html" title="interface in javax.ws.rs.ext"><code>MessageBodyReader</code></a>, |
| <a href="MessageBodyWriter.html" title="interface in javax.ws.rs.ext"><code>MessageBodyWriter</code></a>, |
| <a href="ContextResolver.html" title="interface in javax.ws.rs.ext"><code>ContextResolver</code></a>, |
| <a href="ExceptionMapper.html" title="interface in javax.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> |
| <div class="memberSummary"> |
| <div role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="memberSummary_tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="activeTableTab">All Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t2" class="tableTab" onclick="show(2);">Instance Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t3" class="tableTab" onclick="show(4);">Abstract Methods</button></div> |
| <div id="memberSummary_tabpanel" role="tabpanel"> |
| <table aria-labelledby="t0"> |
| <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> |
| <tbody> |
| <tr class="altColor" id="i0"> |
| <td class="colFirst"><code><T> <a href="ContextResolver.html" title="interface in javax.ws.rs.ext">ContextResolver</a><T></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getContextResolver(java.lang.Class,javax.ws.rs.core.MediaType)">getContextResolver</a></span>​(<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><T> contextType, |
| <a href="../core/MediaType.html" title="class in javax.ws.rs.core">MediaType</a> 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 class="rowColor" id="i1"> |
| <td class="colFirst"><code><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>><br><a href="ExceptionMapper.html" title="interface in javax.ws.rs.ext">ExceptionMapper</a><T></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getExceptionMapper(java.lang.Class)">getExceptionMapper</a></span>​(<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><T> type)</code></th> |
| <td class="colLast"> |
| <div class="block">Get an exception mapping provider for a particular class of exception.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i2"> |
| <td class="colFirst"><code><T> <a href="MessageBodyReader.html" title="interface in javax.ws.rs.ext">MessageBodyReader</a><T></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,javax.ws.rs.core.MediaType)">getMessageBodyReader</a></span>​(<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><T> 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> 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>[] annotations, |
| <a href="../core/MediaType.html" title="class in javax.ws.rs.core">MediaType</a> mediaType)</code></th> |
| <td class="colLast"> |
| <div class="block">Get a message body reader that matches a set of criteria.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i3"> |
| <td class="colFirst"><code><T> <a href="MessageBodyWriter.html" title="interface in javax.ws.rs.ext">MessageBodyWriter</a><T></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,javax.ws.rs.core.MediaType)">getMessageBodyWriter</a></span>​(<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><T> 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> 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>[] annotations, |
| <a href="../core/MediaType.html" title="class in javax.ws.rs.core">MediaType</a> mediaType)</code></th> |
| <td class="colLast"> |
| <div class="block">Get a message body writer that matches a set of criteria.</div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| </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[],javax.ws.rs.core.MediaType)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getMessageBodyReader</h4> |
| <pre class="methodSignature"><T> <a href="MessageBodyReader.html" title="interface in javax.ws.rs.ext">MessageBodyReader</a><T> getMessageBodyReader​(<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><T> 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> 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>[] annotations, |
| <a href="../core/MediaType.html" title="class in javax.ws.rs.core">MediaType</a> 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 javax.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 javax.ws.rs"><code>Consumes</code></a> (x/y > x/* > */*) |
| sorted first. Finally, the |
| <a href="MessageBodyReader.html#isReadable(java.lang.Class,java.lang.reflect.Type,java.lang.annotation.Annotation%5B%5D,javax.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[],javax.ws.rs.core.MediaType)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getMessageBodyWriter</h4> |
| <pre class="methodSignature"><T> <a href="MessageBodyWriter.html" title="interface in javax.ws.rs.ext">MessageBodyWriter</a><T> getMessageBodyWriter​(<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><T> 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> 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>[] annotations, |
| <a href="../core/MediaType.html" title="class in javax.ws.rs.core">MediaType</a> 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 javax.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 javax.ws.rs"><code>Produces</code></a> (x/y > x/* > */*) |
| sorted first. Finally, the |
| <a href="MessageBodyWriter.html#isWriteable(java.lang.Class,java.lang.reflect.Type,java.lang.annotation.Annotation%5B%5D,javax.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"><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>> <a href="ExceptionMapper.html" title="interface in javax.ws.rs.ext">ExceptionMapper</a><T> getExceptionMapper​(<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><T> 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 javax.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,javax.ws.rs.core.MediaType)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>getContextResolver</h4> |
| <pre class="methodSignature"><T> <a href="ContextResolver.html" title="interface in javax.ws.rs.ext">ContextResolver</a><T> getContextResolver​(<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><T> contextType, |
| <a href="../core/MediaType.html" title="class in javax.ws.rs.core">MediaType</a> 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 javax.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 javax.ws.rs"><code>Produces</code></a> (x/y > x/* > */*) |
| 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"> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright (c) 2019 Eclipse Foundation. Licensed under <a href="resources/EFSL.html">Eclipse Foundation Specification License</a>.</small></p> |
| </footer> |
| </body> |
| </html> |