Class CustomMappings

java.lang.Object
org.openehealth.ipf.commons.spring.map.config.CustomMappings
All Implemented Interfaces:
MappingResourceHolder

public class CustomMappings extends Object implements MappingResourceHolder
This class should be used to define the custom mappings in the spring context definition. The resources may be in any mapping format whose loader is on the classpath, and one list may mix them. Where their names do not identify a format - locations without a file extension, resources fetched from a terminology server - set mappingFormat to name the format all of them are in.
   <!-- either as a list of mapping definitions -->
   <bean id="customMapping3"
       class="org.openehealth.ipf.commons.map.config.CustomMappings">
       <property name="mappingResources">
           <list>
               <value>classpath:gender.mapping.xml</value>
               <value>classpath:encounter.mapping.yaml</value>
           </list>
       </property>
   </bean>*
   <!-- or as a single mapping definition -->
   <bean id="customMappingSingle"
       class="org.openehealth.ipf.commons.map.config.CustomMappings">
       <property name="mappingResource" value="classpath:vip.map" />
   </bean>
Author:
Christian Ohr, Boris Stanojevic
See Also:
  • Constructor Details

    • CustomMappings

      public CustomMappings()
  • Method Details

    • getMappingResources

      public Collection<? extends Resource> getMappingResources()
      Specified by:
      getMappingResources in interface MappingResourceHolder
      Returns:
      immutable registered mapping resources
    • addMappingResource

      public void addMappingResource(Resource mappingResource)
      Specified by:
      addMappingResource in interface MappingResourceHolder
    • setMappingResources

      public void setMappingResources(Collection<? extends Resource> mappingResources)
      Description copied from interface: MappingResourceHolder
      Registers a collection of mapping resources
      Specified by:
      setMappingResources in interface MappingResourceHolder
      Parameters:
      mappingResources - mapping resources
    • setMappingResource

      public void setMappingResource(Resource mappingResource)
      Description copied from interface: MappingResourceHolder
      Registers a mapping resource.
      Specified by:
      setMappingResource in interface MappingResourceHolder
      Parameters:
      mappingResource - mapping resource
    • getMappingFormat

      public String getMappingFormat()
      Description copied from interface: MappingResourceHolder
      The format the resources of this holder are read in, for resources whose name does not identify one. One holder groups the mappings of one module, which are typically all in the same format, so it is declared here rather than per resource.
      Specified by:
      getMappingFormat in interface MappingResourceHolder
      Returns:
      a format id, or null to dispatch each resource by its file extension
    • setMappingFormat

      public void setMappingFormat(String mappingFormat)
      Names the format every resource of this bean is read in, rather than leaving it to their file extensions.
      Parameters:
      mappingFormat - a format id such as xml or conceptmap-r4-json, or null to dispatch by file extension