Class Mappings.Builder
java.lang.Object
org.openehealth.ipf.commons.map.Mappings.Builder
- Enclosing interface:
Mappings
Assembles a
Mappings instance from mapping sources and named functions. Sources
are dispatched to a MappingLoader by file extension, or by a
format id where the caller names one, so formats may be
mixed freely; load order is the order in which they are declared here. A builder is spent
once build() has been called, so what it returns cannot be changed afterwards.- Since:
- 6.0
-
Method Summary
Modifier and TypeMethodDescriptionallowOverride(boolean allowOverride) Allows a later mapping source to silently replace a mapping of the same name loaded earlier.allowReverseCollisions(boolean allowReverseCollisions) build()Registers a function that anUnmatched.Computedfallback can refer to.Loads a mapping source, in whichever format its file extension identifies.Loads a mapping source in a format named explicitly, for a source whose name does not identify one:load(URL url, MappingLoader loader) Loads a mapping source with a loader the caller provides, which need not be one theServiceLoadercan see.Registers an already assembled mapping, for programmatic use and for tests.
-
Method Details
-
function
Registers a function that anUnmatched.Computedfallback can refer to. Functions must be registered before the source that refers to them is loaded. -
allowOverride
Allows a later mapping source to silently replace a mapping of the same name loaded earlier. Off by default: a duplicate mapping name is a load-time error. -
allowReverseCollisions
- See Also:
-
load
Loads a mapping source, in whichever format its file extension identifies.- Parameters:
location- a URL, or aclasspath:location such asclasspath:/META-INF/map/atna2fhir.mapping.xml
-
load
Loads a mapping source in a format named explicitly, for a source whose name does not identify one:Mappings.builder() .load("https://tx.example.org/ConceptMap/gender", "conceptmap-r4-json") .build();- Parameters:
location- a URL, or aclasspath:locationformat- aformat idsuch asxml,yamlorconceptmap-r4-json, ornullto dispatch by file extension
-
load
-
load
- See Also:
-
load
Loads a mapping source with a loader the caller provides, which need not be one theServiceLoadercan see. -
load
-
load
- See Also:
-
mapping
Registers an already assembled mapping, for programmatic use and for tests. -
build
-