java.lang.Object
dev.metaschema.core.metapath.function.FunctionLibrary
- All Implemented Interfaces:
IFunctionLibrary
- Direct Known Subclasses:
DefaultFunctionLibrary
Provides a catalog of registered function implementations.
Functions can be registered using the registerFunction(IFunction)
method.
Previously registered functions can be looked up using the
getFunction(IEnhancedQName, int) method.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFunction(IEnhancedQName name, int arity) Retrieve the function with the provided namespace qualified name that supports the signature of the providedarity, if such a function exists.final voidregisterFunction(IFunction function) Register the provided function signature.stream()Retrieve the collection of function signatures in this library as a stream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.metaschema.core.metapath.function.IFunctionLibrary
hasFunction
-
Constructor Details
-
FunctionLibrary
public FunctionLibrary()
-
-
Method Details
-
registerFunction
Register the provided function signature.- Parameters:
function- the function signature to register- Throws:
IllegalArgumentException- if the provided function has the same arity as a previously registered function with the same name
-
stream
Description copied from interface:IFunctionLibraryRetrieve the collection of function signatures in this library as a stream.- Specified by:
streamin interfaceIFunctionLibrary- Returns:
- a stream of function signatures
-
getFunction
Description copied from interface:IFunctionLibraryRetrieve the function with the provided namespace qualified name that supports the signature of the providedarity, if such a function exists.- Specified by:
getFunctionin interfaceIFunctionLibrary- Parameters:
name- the namespace qualified name of a group of functionsarity- the count of arguments for use in determining an argument signature match- Returns:
- the matching function or
nullif no match exists
-