On Fri, Aug 24, 2012 at 6:15 PM, Justin Deoliveira <[email protected]>wrote:
> Yeah, this case isn't really handled all that well. There is an option
> named "complexBindingBaseClass" and "simpleBindingCaseClass" which can be
> used to specify the base class for bindings, but it still will generate a
> class for each binding which isn't really necessary for the emf model based
> stuff.
>
> So yeah, in the end i usually just generate the configuration, and
> manually update them registering the instances of ComplexEMFBinding rather
> than the specific classes. To handle some custom cases where we do have to
> subclass with a custom binding having the generated binding classes is
> nice.
>
Turns out generating those 47 loc requires only 7:
public static void main(String[] args) {
for(Field f : CSW.class.getFields()) {
if((f.getModifiers() & (Modifier.STATIC | Modifier.FINAL)) != 0
&& f.getType().equals(QName.class)) {
System.out.println("bindings.put(CSW." + f.getName() + ",
new ComplexEMFBinding(Csw20Factory.eINSTANCE, CSW." + f.getName() + "));");
}
}
}
Cheers
Andrea
--
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel