blob: 6b764323fc07e76d62ee720c33c4e19d2a044f77 [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>FormParam (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="FormParam (jakarta.ws.rs-api 3.0.0 API)";
}
}
catch(err) {
}
//-->
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/FormParam.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>Field&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.required.element.summary">Required</a>&nbsp;|&nbsp;</li>
<li>Optional</li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.element.detail">Element</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</a></div>
<h2 title="Annotation Type FormParam" class="title">Annotation Type FormParam</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Target.html?is-external=true" title="class or interface in java.lang.annotation" class="externalLink">@Target</a>({<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/ElementType.html?is-external=true#PARAMETER" title="class or interface in java.lang.annotation" class="externalLink">PARAMETER</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/ElementType.html?is-external=true#METHOD" title="class or interface in java.lang.annotation" class="externalLink">METHOD</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/ElementType.html?is-external=true#FIELD" title="class or interface in java.lang.annotation" class="externalLink">FIELD</a>})
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html?is-external=true" title="class or interface in java.lang.annotation" class="externalLink">@Retention</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/RetentionPolicy.html?is-external=true#RUNTIME" title="class or interface in java.lang.annotation" class="externalLink">RUNTIME</a>)
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html?is-external=true" title="class or interface in java.lang.annotation" class="externalLink">@Documented</a>
public @interface <span class="memberNameLabel">FormParam</span></pre>
<div class="block">Binds the value(s) of a form parameter contained within a request entity body to a resource method parameter. Values
are URL decoded unless this is disabled using the <a href="Encoded.html" title="annotation in jakarta.ws.rs"><code>Encoded</code></a> annotation. A default value can be specified using
the <a href="DefaultValue.html" title="annotation in jakarta.ws.rs"><code>DefaultValue</code></a> annotation. If the request entity body is absent or is an unsupported media type, the
default value is used.
The type <code>T</code> of the annotated parameter must either:
<ol>
<li>Be a primitive type</li>
<li>Have a constructor that accepts a single <code>String</code> argument</li>
<li>Have a static method named <code>valueOf</code> or <code>fromString</code> that accepts a single <code>String</code> argument
(see, for example, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true#valueOf(java.lang.String)" title="class or interface in java.lang" class="externalLink"><code>Integer.valueOf(String)</code></a>)</li>
<li>Have a registered implementation of <a href="ext/ParamConverterProvider.html" title="interface in jakarta.ws.rs.ext"><code>ParamConverterProvider</code></a> JAX-RS extension SPI that
returns a <a href="ext/ParamConverter.html" title="interface in jakarta.ws.rs.ext"><code>ParamConverter</code></a> instance capable of a "from string" conversion for the type.</li>
<li>Be <code>List&lt;T&gt;</code>, <code>Set&lt;T&gt;</code> or <code>SortedSet&lt;T&gt;</code>, where <code>T</code> satisfies 2, 3 or 4 above. The
resulting collection is read-only.</li>
</ol>
<p>
If the type is not one of the collection types listed in 5 above and the form parameter is represented by multiple
values then the first value (lexically) of the parameter is used.
</p>
<p>
If this annotation is used to bind form parameters, a JAX-RS implementation MUST use the entity provider API
to create a <a href="core/Form.html" title="class in jakarta.ws.rs.core"><code>Form</code></a> and derive the values from this instance. If there is at least one
<a href="FormParam.html" title="annotation in jakarta.ws.rs"><code>FormParam</code></a> for a resource method, JAX-RS implementations MUST support a <a href="core/Form.html" title="class in jakarta.ws.rs.core"><code>Form</code></a>
entity parameter for the same method. Support for other entity parameter types is OPTIONAL.
</p>
<p>
Note that, whilst the annotation target permits use on fields and methods, this annotation is only required to be
supported on resource method parameters.
</p></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="DefaultValue.html" title="annotation in jakarta.ws.rs"><code>DefaultValue</code></a>,
<a href="Encoded.html" title="annotation in jakarta.ws.rs"><code>Encoded</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="annotation.type.required.element.summary">
<!-- -->
</a>
<h3>Required Element Summary</h3>
<table class="memberSummary">
<caption><span>Required Elements</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Required Element</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#value()">value</a></span></code></th>
<td class="colLast">
<div class="block">Defines the name of the form parameter whose value will be used to initialize the value of the annotated method
argument.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="annotation.type.element.detail">
<!-- -->
</a>
<h3>Element Detail</h3>
<a id="value()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>value</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;value</pre>
<div class="block">Defines the name of the form parameter whose value will be used to initialize the value of the annotated method
argument. The name is specified in decoded form, any percent encoded literals within the value will not be decoded
and will instead be treated as literal text. E.g. if the parameter name is "a b" then the value of the annotation is
"a b", <i>not</i> "a+b" or "a%20b".</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>form parameter name.</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/FormParam.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>Field&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.required.element.summary">Required</a>&nbsp;|&nbsp;</li>
<li>Optional</li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.element.detail">Element</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>