On Wed, Aug 15, 2012 at 3:52 AM, Jody Garnett <[email protected]>wrote:
> Sounds great !
>
> My email suggested doing "class name.field" as well as converters. I think
> you could get away with making that a converter for the same effect.
>
Ok, work committed on trunk.
The usage of defaults is documented in the DescribeParameter javadoc:
https://github.com/geotools/geotools/blob/master/modules/unsupported/process/src/main/java/org/geotools/process/factory/DescribeParameter.java
It first tries to interpret the string as a reference to a constant, either
absolute (using the javadoc syntax which is already well known to devs, no
need to create a new one) or local either to the process or to the target
type (the reason to try constant first is that otherwise constants for
string
data would not have been possible).
In the end I added such support in the AnnotatedProcessFactory, inside the
converters it would have been trouble performance wise (it would
have been too a generic converter and its work has to catch quite a bit of
exceptions looking up for fields and classes)
For the tests I've also written a process that tests most of the ways a
constant can be defined, see here:
https://github.com/geotools/geotools/blob/master/modules/unsupported/process/src/test/java/org/geotools/process/factory/DefaultsProcess.java
and the test is here:
https://github.com/geotools/geotools/blob/master/modules/unsupported/process/src/test/java/org/geotools/process/factory/BeanProcessFactoryTest.java#L177
I'll let it rest a bit on trunk, if nothing bad pops up and I don't forget,
I would like to backport this to 8.x too
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