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