I am not in favor of introducing script language processing as part of creating plugins, which seems to be what the camel annotations Matt referenced do.
Sent from my iPad > On Jun 2, 2014, at 2:47 PM, Gary Gregory <garydgreg...@gmail.com> wrote: > > Are we considering a 3rd way to do configs? Or is this just for defaults? Are > you suggesting we _duplicate_ what Camel does or that we _depend on_ Camel > for this kind of config? > > Gary > > >> On Mon, Jun 2, 2014 at 5:08 PM, Matt Sicker <boa...@gmail.com> wrote: >> Hmm, I like the annotations for script style stuff, actually. See for >> instance what Camel offers in that regard: >> >> http://camel.apache.org/annotation-based-expression-language.html >> >> >>> On 2 June 2014 10:28, Ralph Goers <rgo...@apache.org> wrote: >>> That is essentially the same thing Matt is doing with his builders. >>> >>> Sent from my iPad >>> >>>> On Jun 2, 2014, at 7:57 AM, Gary Gregory <garydgreg...@gmail.com> wrote: >>>> >>>>> On Mon, Jun 2, 2014 at 10:57 AM, Gary Gregory <garydgreg...@gmail.com> >>>>> wrote: >>>>> >>>>>> On Mon, Jun 2, 2014 at 10:34 AM, Ralph Goers <rgo...@apache.org> wrote: >>>>>> I don't recall Jackson providing a way to specify constraints or default >>>>>> values. Does it? >>>>> >>>>> I do not think so, but you an init a non-final field yourself and let >>>>> Jackson override it as suggested here: >>>> >>>> http://jackson-users.ning.com/forum/topics/default-value-for-missing-int-property-when-deserializing-json >>>> >>>> Gary >>>> >>>>> >>>>> >>>>>> >>>>>> Sent from my iPad >>>>>> >>>>>>> On Jun 2, 2014, at 6:19 AM, Gary Gregory <garydgreg...@gmail.com> wrote: >>>>>>> >>>>>>> I'm not trying to handle all cases under the sun. But... we've chosen >>>>>>> NOT to use an XML Schema based XML IO framework (like JAXB or Jackson), >>>>>>> instead we've invented our own. I know we do JSON as well, but so does >>>>>>> Jackson and it likely also has a plugin for YAML. So now, every time >>>>>>> I'm looking for some minor improvement, it means tweaking our custom >>>>>>> framework or adding boilerplate code to plugins. It's a pain, but >>>>>>> that's where we are today. At least now, with the new type converters, >>>>>>> I get the type conversion from to int for free :-) >>>>>>> >>>>>>> In this case, I meant, you can only use attribute A or B. >>>>>>> >>>>>>> It is probably worth stepping back and looking at the big picture and >>>>>>> whether we want to invest in improving the current config IO framework >>>>>>> or at least consider if Jackson would be a better fit. Likely not for >>>>>>> 2.0 ;-) >>>>>>> >>>>>>> Gary >>>>>>> >>>>>>> >>>>>>>> On Mon, Jun 2, 2014 at 4:03 AM, Ralph Goers <rgo...@apache.org> wrote: >>>>>>>> Are you looking for annotations to handle every kind of thing you >>>>>>>> might like to do instead of just putting a couple lines of code in the >>>>>>>> factory method? I would have handled this by saying foo and bar both >>>>>>>> need to be Integer and then adding a line do code that insures exactly >>>>>>>> one, or at most one, is present ( depending on what you want ). >>>>>>>> >>>>>>>> I really have no idea what it means for an attribute or element to be >>>>>>>> in a "choice". Does it mean at most one is specified or exactly one? >>>>>>>> What if I want exactly one in some cases and at most one in others? >>>>>>>> >>>>>>>> Ralph >>>>>>>> >>>>>>>>> On Jun 1, 2014, at 11:53 PM, Gary Gregory <garydgreg...@gmail.com> >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>> How do I tell my plugin that it can have attribute1 or 2, but not >>>>>>>>> both? IOW I want the config framework to do the validation for me. >>>>>>>>> >>>>>>>>> How about: >>>>>>>>> >>>>>>>>> @PluginAttribute(choice="group1") int foo, >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> @PluginAttribute(choice="group1") int bar >>>>>>>>> >>>>>>>>> Same thing for elements. >>>>>>>>> >>>>>>>>> Thoughts? >>>>>>>>> Gary >>>>>>>>> >>>>>>>>> -- >>>>>>>>> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org >>>>>>>>> Java Persistence with Hibernate, Second Edition >>>>>>>>> JUnit in Action, Second Edition >>>>>>>>> Spring Batch in Action >>>>>>>>> Blog: http://garygregory.wordpress.com >>>>>>>>> Home: http://garygregory.com/ >>>>>>>>> Tweet! http://twitter.com/GaryGregory >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org >>>>>>> Java Persistence with Hibernate, Second Edition >>>>>>> JUnit in Action, Second Edition >>>>>>> Spring Batch in Action >>>>>>> Blog: http://garygregory.wordpress.com >>>>>>> Home: http://garygregory.com/ >>>>>>> Tweet! http://twitter.com/GaryGregory >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org >>>>> Java Persistence with Hibernate, Second Edition >>>>> JUnit in Action, Second Edition >>>>> Spring Batch in Action >>>>> Blog: http://garygregory.wordpress.com >>>>> Home: http://garygregory.com/ >>>>> Tweet! http://twitter.com/GaryGregory >>>> >>>> >>>> >>>> -- >>>> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org >>>> Java Persistence with Hibernate, Second Edition >>>> JUnit in Action, Second Edition >>>> Spring Batch in Action >>>> Blog: http://garygregory.wordpress.com >>>> Home: http://garygregory.com/ >>>> Tweet! http://twitter.com/GaryGregory >> >> >> >> -- >> Matt Sicker <boa...@gmail.com> > > > > -- > E-Mail: garydgreg...@gmail.com | ggreg...@apache.org > Java Persistence with Hibernate, Second Edition > JUnit in Action, Second Edition > Spring Batch in Action > Blog: http://garygregory.wordpress.com > Home: http://garygregory.com/ > Tweet! http://twitter.com/GaryGregory