Class SpringBidiMappingService
java.lang.Object
org.openehealth.ipf.commons.map.BidiMappingService
org.openehealth.ipf.commons.spring.map.SpringBidiMappingService
- All Implemented Interfaces:
MappingService, MappingResourceTarget, Aware, BeanFactoryAware, SmartInitializingSingleton
@Deprecated(since="6.0",
forRemoval=true)
public class SpringBidiMappingService
extends BidiMappingService
implements MappingResourceTarget, BeanFactoryAware, SmartInitializingSingleton
Deprecated, for removal: This API element is subject to removal in a future version.
BidiMappingService implementation that can be configured with Spring
resources.
A resource is dispatched to a loader by its file extension, so the mapping files an application
registers may be in any format whose module is on the classpath - .mapping.xml,
.mapping.yaml, .conceptmap.r4.json or the legacy .map - and one list may
mix them.
When this service owns its mappings, it collects the MappingResourceHolder beans (usually
CustomMappings instances) of the
application context itself, so no further beans are required:
<bean id="mappingService"
class="org.openehealth.ipf.commons.spring.map.SpringBidiMappingService"/>
Collecting happens in afterSingletonsInstantiated(), i.e. from within
finishBeanFactoryInitialization and thus before the ContextRefreshedEvent
that starts e.g. the Camel context. Contributions can be ordered relative to each other
with Spring's @Order / Ordered on the MappingResourceHolder bean.
Reading resources is left to a SpringMappings: one this service creates for itself, or,
with SpringBidiMappingService(SpringMappings), the application's bean, which then does
the collecting so that the mappings the two share are read exactly once.
- Since:
- 3.1
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.SpringBidiMappingService(SpringMappings mappings) Deprecated, for removal: This API element is subject to removal in a future version.Adapts mappings somebody else owns, so that an application can keep using the untyped service while the mappings themselves are configured, and read, throughSpringMappings. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated, for removal: This API element is subject to removal in a future version.Collects the mapping resources of allMappingResourceHolderbeans of the application context and its ancestors, honouring their@Order.booleanDeprecated, for removal: This API element is subject to removal in a future version.Collection<? extends Resource> Deprecated, for removal: This API element is subject to removal in a future version.voidsetBeanFactory(@NonNull BeanFactory beanFactory) Deprecated, for removal: This API element is subject to removal in a future version.voidsetIgnoreResourceNotFound(boolean ignoreResourceNotFound) Deprecated, for removal: This API element is subject to removal in a future version.Whether a resource that does not exist or cannot be read is skipped instead of failing the context.voidsetMappingResource(Resource resource) Deprecated, for removal: This API element is subject to removal in a future version.voidsetMappingResources(Collection<? extends Resource> resources) Deprecated, for removal: This API element is subject to removal in a future version.Reads every resource and registers the mappings it contains.voidsetMappingResources(Collection<? extends Resource> resources, String format) Deprecated, for removal: This API element is subject to removal in a future version.Reads every resource in a format named explicitly, for resources whose name does not identify one - a location without a file extension, or a file calledgender.xml.Methods inherited from class BidiMappingService
clearMappings, get, get, getKey, getKey, getKeySystem, getMappings, getScripts, getValueSystem, keys, mappingKeys, registerMappingFunction, setMappingFunctions, setMappingScript, setMappingScripts, values
-
Constructor Details
-
SpringBidiMappingService
public SpringBidiMappingService()Deprecated, for removal: This API element is subject to removal in a future version. -
SpringBidiMappingService
Deprecated, for removal: This API element is subject to removal in a future version.Adapts mappings somebody else owns, so that an application can keep using the untyped service while the mappings themselves are configured, and read, throughSpringMappings. TheSpringMappingsmust be a bean of the application context, since it collects theMappingResourceHolderbeans itself; one created in place and handed in here never does.- Parameters:
mappings- the mappings to delegate to
-
-
Method Details
-
setBeanFactory
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
setBeanFactoryin interfaceBeanFactoryAware- See Also:
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated()Deprecated, for removal: This API element is subject to removal in a future version.Collects the mapping resources of allMappingResourceHolderbeans of the application context and its ancestors, honouring their@Order. Does nothing if the mappings belong to aSpringMappingsbean, which collects them itself.- Specified by:
afterSingletonsInstantiatedin interfaceSmartInitializingSingleton
-
getMappingResources
Deprecated, for removal: This API element is subject to removal in a future version. -
setMappingResource
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
setMappingResources
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:MappingResourceTargetReads every resource and registers the mappings it contains. Which format a resource is in is decided by its file extension.- Specified by:
setMappingResourcesin interfaceMappingResourceTarget- Parameters:
resources- mapping resources
-
setMappingResources
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:MappingResourceTargetReads every resource in a format named explicitly, for resources whose name does not identify one - a location without a file extension, or a file calledgender.xml.- Specified by:
setMappingResourcesin interfaceMappingResourceTarget- Parameters:
resources- mapping resourcesformat- aformat idsuch asxmlorconceptmap-r4-json, ornullto dispatch by file extension
-
setIgnoreResourceNotFound
public void setIgnoreResourceNotFound(boolean ignoreResourceNotFound) Deprecated, for removal: This API element is subject to removal in a future version.Whether a resource that does not exist or cannot be read is skipped instead of failing the context. Applies to theSpringMappingsthis service reads into. -
getIgnoreResourceNotFound
public boolean getIgnoreResourceNotFound()Deprecated, for removal: This API element is subject to removal in a future version.
-
SpringMappingsand the typedMappingsAPI. This class remains as an adapter for applications still holding aMappingService, and is scheduled for removal in IPF 7.0.