Class FunctionLibrary
- java.lang.Object
-
- gov.nist.secauto.metaschema.core.metapath.function.FunctionLibrary
-
- All Implemented Interfaces:
IFunctionLibrary
- Direct Known Subclasses:
DefaultFunctionLibrary
public class FunctionLibrary extends Object implements IFunctionLibrary
-
-
Constructor Summary
Constructors Constructor Description FunctionLibrary()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFunction
getFunction(String name, List<IExpression> args)
Retrieve the function with the provided name that supports the signature of the provided methods, if such a function exists.IFunction
getFunction(QName name, List<IExpression> args)
Retrieve the function with the provided namespace qualified name that supports the signature of the provided methods, if such a function exists.Stream<IFunction>
getFunctionsAsStream()
Retrieve the collection of function signatures in this library as a stream.void
registerFunction(IFunction function)
Register the provided function signature.protected void
registerFunctionByName(IFunction function)
protected void
registerFunctionByQName(IFunction function)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gov.nist.secauto.metaschema.core.metapath.function.IFunctionLibrary
hasFunction, hasFunction
-
-
-
-
Constructor Detail
-
FunctionLibrary
public FunctionLibrary()
-
-
Method Detail
-
registerFunction
public void registerFunction(@NonNull IFunction function)
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
-
registerFunctionByQName
protected void registerFunctionByQName(@NonNull IFunction function)
-
registerFunctionByName
protected void registerFunctionByName(@NonNull IFunction function)
-
getFunctionsAsStream
public Stream<IFunction> getFunctionsAsStream()
Description copied from interface:IFunctionLibrary
Retrieve the collection of function signatures in this library as a stream.- Specified by:
getFunctionsAsStream
in interfaceIFunctionLibrary
- Returns:
- a stream of function signatures
-
getFunction
public IFunction getFunction(@NonNull String name, @NonNull List<IExpression> args)
Description copied from interface:IFunctionLibrary
Retrieve the function with the provided name that supports the signature of the provided methods, if such a function exists.- Specified by:
getFunction
in interfaceIFunctionLibrary
- Parameters:
name
- the name of a group of functionsargs
- a list of argument expressions for use in determining an argument signature match- Returns:
- the matching function or
null
if no match exists
-
getFunction
public IFunction getFunction(@NonNull QName name, @NonNull List<IExpression> args)
Description copied from interface:IFunctionLibrary
Retrieve the function with the provided namespace qualified name that supports the signature of the provided methods, if such a function exists.- Specified by:
getFunction
in interfaceIFunctionLibrary
- Parameters:
name
- the namespace qualified name of a group of functionsargs
- a list of argument expressions for use in determining an argument signature match- Returns:
- the matching function or
null
if no match exists
-
-