Class MappingFunctionRegistry
java.lang.Object
org.openehealth.ipf.commons.map.MappingFunctionRegistry
- All Implemented Interfaces:
MappingFunctions
Named functions that an
Unmatched.Computed fallback can refer to.
A mapping file names a function; the function itself is written, and unit-tested, in Java.
That is the whole of what the Groovy DSL's arbitrary (ELSE) closures are needed for
in practice — across all mapping files shipped with IPF exactly one fallback computes
anything.
Functions get here either explicitly, through Mappings.Builder.function(String, Function), or from a
MappingFunctionProvider that a module ships alongside a mapping file of its own.
- Since:
- 6.0
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
MappingFunctionRegistry
public MappingFunctionRegistry()
-
-
Method Details
-
register
Registers a function under the given name, replacing any function registered before under that name.- Parameters:
name- function name, as referred to byUnmatched.Computed.ref()function- the function; it must tolerate anullargument- Returns:
- this registry
-
registerAll
Registers every function of another registry, replacing any registered before under the same name.- Parameters:
other- the registry to copy from- Returns:
- this registry
-
copy
- Returns:
- a registry holding the same functions, to register into without affecting this one
-
lookup
- Specified by:
lookupin interfaceMappingFunctions- Parameters:
name- function name, as referred to byUnmatched.Computed.ref()- Returns:
- the function registered under that name
-
contains
- Specified by:
containsin interfaceMappingFunctions- Parameters:
name- function name- Returns:
- whether a function is registered under that name
-
clear
public void clear()
-