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.

Give it a go.

--
Jody Garnett

On 15/08/2012, at 4:05 AM, Andrea Aime <[email protected]> wrote:

On Tue, Aug 14, 2012 at 10:23 AM, Andrea Aime
<[email protected]>wrote:

> Non trivial processes tend to have complex input parameters, beans instead
> of common "primitives"
> (to be interpreted in a lax way, e.g., Date as a primitive too), such as
> ranges, lists of values.
>
> I'm tempted to just go the way to suggest though, it covers a good number
> of use cases and it's
> the easiest way for the user to deal with.
>

I've coded this up, here is the patch:
https://github.com/aaime/geotools/commit/23b41be622bc01e6a84b9ba93fde99ef735292cd

Basically I'm using converters to convert from string to object as you
suggested.
Two things to notice:
- I ported back a enum converter from GeoServer that I wrote myself (so I
have rights on relicensing to LGPL)
- I had to make sure the types of the params are never reported as being
primitives (e.g boolean.class)
  as that breaks converters solid, and due to the usage of generics it's
actually not possible to fix
  the converters itself (there is no way to cast a primitive to a generic
type)

One thing that we might want to add is a converter that takes either a
name, which is supposed
to be the name a constant in the target class (e.g., Filter.INCLUDE), to
grab values from constants,
and also support the "this.is.my.package.Class#constant" syntax to fetch
constant values from
converters itself.
Just an idea.

Ok to commit?

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

Reply via email to