describe function with functionname - STEMLab/geotools GitHub Wiki
-
Contact: Jody Garnett
-
Tagline: describe a function
The gt-opengis interfaces provide the concept of *FunctionName*. We currently make FunctionName available through the FunctionFactory interface; this offers a the name of the function, the number of arguments, and the names of each argument that can be presented to the user.
Our default implementation, DefaultFunctionFinder, using FactorySPI reflection against Function implementation is is only able to fake this information.
I would like to make this information available by adding:
- Function.getFunctionName()
- FunctionFinder.getFunctionNames()
- FilterFactory.functionName(name, nargs, argNames)
See tasks for a description of the current patch.
The optional part of this proposal has been carved off as a separate undertaking: FilterFactory cleanup
This proposal needs some discussion; but it already has a patch on the attached JIRA.
Voting has not started yet:
-
Andrea Aime +0
-
Ian Turton +1
-
Jody Garnett +1
-
| :white_check_mark: | :no_entry: | :warning: | :negative_squared_cross_mark: |
------------|--------------------|------------|-------------------------|-------------------------------| no progress | done | impeded | lack mandate/funds/time | volunteer needed |
- ✅ Add Filter.getFunctionName()
- ✅ Update the base classes (so existing implementations will work)
- ✅ Update the unique implementations (making use of static NAME field where provided)
- ✅ Remove deprecated CommonFactoryFinder.getFunctionExpression() as it has not been used or useful for ages
- ✅ Update DefaultFunctionFactory to use Name information (yay!)
- ✅ Addition of FilterFactory.functionName(String name, int nargs, List<String> argNames) (preexisting mistake)
- ✅ No sample code is effected by this change
- Update the user guide diagram and text for Function
BEFORE
public interface Function extends Expression {
String getName();
List<Expression> getParameters();
Literal getFallbackValue();
}
interface FilterFactory {
....
/** function name */
FunctionName functionName(String name, int nargs);
...
}
class FunctionFinder {
..
}
AFTER
public interface Function extends Expression {
String getName();
FunctionName getFunctionName();
List<Expression> getParameters();
Literal getFallbackValue();
}
interface FilterFactory {
....
/** function name */
FunctionName functionName(String name, int nargs);
FunctionName functionName(String name, int nargs, List<String> argNames);
...
}
class FunctionFinder {
List<FunctionName> getAllFunctionDescriptions()
FunctionName findFunctionDescription(String)
..
}