Andrea Aime wrote:
>> No I would personally register both if we are doing that sort of
>> thing ...
>>
>> I would rather see a "Library" plugin; where a library has
>> implementations (Function?) and descriptions (FunctionName) available.
>> I would personally always create a plain FunctionImpl out of
>> FilterFactoryImpl; the FunctionImpl can hold onto the fallback value
>> (ie the value to use if the function is not found) - and when you
>> call evaluate it can look an implementation then ... much like we do
>> with PropertyName.
> Ok, you totally confused me there. What has function to do with
> property extraction from a feature?
Same design
Factory creates a Property implementation (ie AttributeExpressionImpl );
inside the PropertyExpression the evaulate method is like the following:
> public Object evaluate(Object obj, Class target) {
> PropertyAccessor accessor = getPropertyAccessor(obj, target);
> ...
> PropertyAccessors.findPropertyAccessor( obj, attPath, target,
> hints );
See how it looks up a geotools specific plugin (property accessors) in
order to "fill in the implementation" for the AttributeExpressionImpl.
We can take this same approach with function...
>>>> That is already there in some form; you can find the FunctionNames
>>>> in the FilterCapabilities data structure.
>>> Is there? This is the GeoApi FilterCapabilities interface:
>> I think it is part of ScalarCapabilities ... keep going in.
> It's not. I cannot find it in any of the objects linked from
> FilterCapabilities.
Let me look; ... I remember getting stuck on this as I filled in the
filter capabilities data structure (when trying to work on WFS filter
splitting).
Here we are:
-FilterCapabilities -> ScalarCapabilities -> ArithmeticOperators ->
Functions.
Where:
interface Functions {
FunctionName getFunctionName(String name)
Collection<FunctionName> getFunctionNames()
}
Cheers,
Jody
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel