Class BuiltinFunctionLibrary
java.lang.Object
com.darkcollective.relix.function.builtin.BuiltinFunctionLibrary
- All Implemented Interfaces:
FunctionLibrary
The functions relix ships with: the scalars — string, numeric, temporal, conditional,
type-check, conversion and nested-data — and the eight aggregates.
It is an ordinary FunctionLibrary, discovered the same way any other is and
built out of the same published seam. Nothing about it is privileged: a library that
declares a higher priority replaces any
function here by name, and one that declares a lower priority fills gaps around it.
This class exists to be found by ServiceLoader, so it has a public
no-argument constructor and is declared as a provider in both of the two places
discovery looks.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe aggregates this library offers.documentation(String docKey) The reference page for one of this library's functions, read from the library's own resources.name()A short identifier for this library, used in diagnostics — including the one that reports two libraries offering the same function name.The scalar functions this library offers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.darkcollective.relix.function.FunctionLibrary
priority
-
Field Details
-
NAME
The name this library reports, including in a message about a name clash.- See Also:
-
-
Constructor Details
-
BuiltinFunctionLibrary
public BuiltinFunctionLibrary()Creates the library. Discovery calls this; there is nothing to configure.
-
-
Method Details
-
name
Description copied from interface:FunctionLibraryA short identifier for this library, used in diagnostics — including the one that reports two libraries offering the same function name.- Specified by:
namein interfaceFunctionLibrary- Returns:
- the library's name; never
nullor blank
-
scalarFunctions
Description copied from interface:FunctionLibraryThe scalar functions this library offers.- Specified by:
scalarFunctionsin interfaceFunctionLibrary- Returns:
- the scalar functions; empty by default
-
aggregateFunctions
Description copied from interface:FunctionLibraryThe aggregates this library offers.- Specified by:
aggregateFunctionsin interfaceFunctionLibrary- Returns:
- the aggregates; empty by default
-
documentation
The reference page for one of this library's functions, read from the library's own resources.The pages are the repository's
docs/reference/functionstree, copied in at build time rather than moved: they are still read from the source tree by the PDF build and the training-corpus extractor, and a page has one home.- Specified by:
documentationin interfaceFunctionLibrary- Parameters:
docKey- the documentation key of one of this library's functions- Returns:
- the Markdown page, or empty when this library has no page under that key
-