juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Bognar (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JUNEAU-29) Replace @BeanConstructor with @BeanParameter annotations.
Date Fri, 30 Nov 2018 21:23:00 GMT

    [ https://issues.apache.org/jira/browse/JUNEAU-29?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16705292#comment-16705292
] 

James Bognar commented on JUNEAU-29:
------------------------------------

This is missing details.  I'll fill it in.

The @BeanConstructor annotation is described here:

[http://juneau.apache.org/site/apidocs-7.2.2/overview-summary.html#juneau-marshall.Transforms.BeanConstructorAnnotation]

In a nutshell, the annotation can be used to identify bean property names on constructor parameters. 

e.g.
{code:java}
@BeanConstructor(properties="name,age") 
public Person(String name, int age) { 
   this.name = name; 
   this.age = age; 
}
{code}
What this request is to add an annotation that can be applied to the parameters directly.

e.g.
{code:java}
@BeanConstructor 
public Person(@BeanParam("name") String name, @BeanParam("age") int age) { 
   this.name = name; 
   this.age = age; 
}
{code}
One possibility is to allow you to used the existing @BeanProperty annotation on constructor
arguments.

[http://juneau.apache.org/site/apidocs-7.2.2/overview-summary.html#juneau-marshall.Transforms.BeanPropertyAnnotation]

 

 

> Replace @BeanConstructor with @BeanParameter annotations.
> ---------------------------------------------------------
>
>                 Key: JUNEAU-29
>                 URL: https://issues.apache.org/jira/browse/JUNEAU-29
>             Project: Juneau
>          Issue Type: Bug
>          Components: Code
>    Affects Versions: 6.1.0
>            Reporter: James Bognar
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message