Class XmlMappingLoader
java.lang.Object
org.openehealth.ipf.commons.map.xml.XmlMappingLoader
- All Implemented Interfaces:
MappingLoader
MappingLoader for *.mapping.xml files, the recommended format for IPF's own
mappings.
Every file is validated against META-INF/ipf/mapping.xsd as it is read, so an unknown element,
an unknown attribute or a misspelt one is an error at startup with a line and a column.
The two constraints the schema language cannot express, that mode="fixed" needs a value and mode="function" a
registered function, are checked here.
- Since:
- 6.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformat()Short, stable identifier of the format this loader reads, e.g.load(InputStream in, URI source, MappingFunctionRegistry functions) Reads all mappings contained in one source document.booleanWhether this loader claims a source that nobody named a format for.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MappingLoader
load
-
Field Details
-
EXTENSION
File extension this loader claims. Two-part on purpose:.xmlalone says nothing about which of the many XML formats in healthcare integration a file holds.- See Also:
-
FORMAT
Format id under which this loader can be selected explicitly.- See Also:
-
-
Constructor Details
-
XmlMappingLoader
public XmlMappingLoader()
-
-
Method Details
-
format
Description copied from interface:MappingLoaderShort, stable identifier of the format this loader reads, e.g.xml,yamlorconceptmap-r4-json. It is what a caller names to select this loader regardless of the source's file extension, and it is compared case-insensitively.Two loaders on one classpath must not share a format id, since the id is what picks one of them; qualify it the way
conceptmap-r4-jsondoes when a format has versions or encodings that a second loader might read.- Specified by:
formatin interfaceMappingLoader- Returns:
- the format id, never
nullor blank
-
supports
Description copied from interface:MappingLoaderWhether this loader claims a source that nobody named a format for. Implementations decide by file extension: a source it cannot recognize from its name alone is not its own, even if it could read the content, because that is what keeps dispatch predictable.- Specified by:
supportsin interfaceMappingLoader- Parameters:
source- location of the mapping source, used for its file extension- Returns:
- whether this loader can read the given source
-
load
Description copied from interface:MappingLoaderReads all mappings contained in one source document.- Specified by:
loadin interfaceMappingLoader- Parameters:
in- the source content; the caller closes the streamsource- location of the source, for diagnosticsfunctions- registry a loader may add functions to, and against which it should validate anyUnmatched.Computedreference it produces- Returns:
- the mappings read, in declaration order
-