[jbosstools-issues] [JBoss JIRA] (JBIDE-16825) Provide support for new @BeanParam JAX-RS Annotation
Xavier Coulon (JIRA)
issues at jboss.org
Thu May 22 16:20:56 EDT 2014
[ https://issues.jboss.org/browse/JBIDE-16825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Xavier Coulon updated JBIDE-16825:
----------------------------------
Description:
See JAX-RS Spec Appendix A (p66):
BeanParam
{quote}
Can be used to inject a user-defined bean whose fields and properties may be annotated with JAX-RS param annotations.
{quote}
For example:
{code}
public class MyBeanParam {
@PathParam("p")
private String pathParam;
@MatrixParam("m")
@Encoded
@DefaultValue("default")
private String matrixParam;
@HeaderParam("header")
private String headerParam;
private String queryParam;
public MyBeanParam(@QueryParam("q") String queryParam) {
this.queryParam = queryParam;
}
public String getPathParam() {
return pathParam;
}
...
}
{code}
then
{code}
@POST
public void post(@BeanParam MyBeanParam beanParam, String entity) {
final String pathParam = beanParam.getPathParam(); // contains injected path parameter "p"
...
}
{code}
was:
See JAX-RS Spec Appendix A (p66):
BeanParam
{quote}
Can be used to inject a user-defined bean whose fields and properties may be annotated with JAX-RS param annotations.
{quote}
> Provide support for new @BeanParam JAX-RS Annotation
> ----------------------------------------------------
>
> Key: JBIDE-16825
> URL: https://issues.jboss.org/browse/JBIDE-16825
> Project: Tools (JBoss Tools)
> Issue Type: Sub-task
> Components: webservices
> Affects Versions: 4.1.1.Final
> Reporter: Xavier Coulon
> Assignee: Xavier Coulon
> Fix For: 4.2.0.Beta2
>
>
> See JAX-RS Spec Appendix A (p66):
> BeanParam
> {quote}
> Can be used to inject a user-defined bean whose fields and properties may be annotated with JAX-RS param annotations.
> {quote}
> For example:
> {code}
> public class MyBeanParam {
> @PathParam("p")
> private String pathParam;
>
> @MatrixParam("m")
> @Encoded
> @DefaultValue("default")
> private String matrixParam;
>
> @HeaderParam("header")
> private String headerParam;
>
> private String queryParam;
>
> public MyBeanParam(@QueryParam("q") String queryParam) {
> this.queryParam = queryParam;
> }
>
> public String getPathParam() {
> return pathParam;
> }
> ...
> }
> {code}
> then
> {code}
> @POST
> public void post(@BeanParam MyBeanParam beanParam, String entity) {
> final String pathParam = beanParam.getPathParam(); // contains injected path parameter "p"
> ...
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
More information about the jbosstools-issues
mailing list