thanks If a @DataBoundConstructor is required then this new annotation only offer half the benefit I expected :'( I also wonder why the name, not just "@DataBound". Time for a pull-request :)
2014-09-02 14:20 GMT+02:00 Christopher Orr <[email protected]>: > Hi Nicolas, > > > On 02/09/14 14:09, nicolas de loof wrote: > >> I'm trying to use filed-based databinding : >> >> public class MyBuildWrapper extends BuildWrapper { >> >> @DataBoundSetter >> public String data; >> >> // no constructor >> >> >> I receive this error : >> >> Caused by: org.kohsuke.stapler.NoStaplerConstructorException: There's no >> @DataBoundConstructor on any constructor of class com.....MyBuildWrapper >> at >> org.kohsuke.stapler.ClassDescriptor.loadConstructorParamNames( >> ClassDescriptor.java:177) >> > > I haven't looked at the Jenkins source, but as the error message suggests, > it seems that you still need to have a constructor with the > @DataBoundConstructor, even if that constructor is empty. With that, > @DataBoundSetter works well for me: > > https://github.com/orrc/google-play-android-publisher- > plugin/blob/a80c656/src/main/java/org/jenkinsci/plugins/ > googleplayandroidpublisher/ApkPublisher.java#L67-L82 > > > > Does this actually work ? I can't find any plugin to rely on this >> (recently introduced) pattern >> > > There seems to be a couple of examples out there: > https://github.com/search?q=user%3Ajenkinsci+databoundsetter&type=Code > > Regards, > Chris > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
