com.gitlab.spacetrucker.modularspringcontexts.module.MapNamespaceHandlerResolver Maven / Gradle / Ivy
package com.gitlab.spacetrucker.modularspringcontexts.module;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.xml.NamespaceHandler;
import org.springframework.beans.factory.xml.NamespaceHandlerResolver;
/**
* Implementation of {@link NamespaceHandlerResolver} that resolves a
* {@code namespaceUri} according to the values of a predefined {@code Map}.
*/
public class MapNamespaceHandlerResolver implements NamespaceHandlerResolver {
private Map namespaceUriToHandler = new HashMap<>();
@Override
public NamespaceHandler resolve(String namespaceUri) {
return namespaceUriToHandler.get(namespaceUri);
}
public void setNamespaceUriToHandler(Map namespaceUriToHandler) {
this.namespaceUriToHandler = new HashMap<>(namespaceUriToHandler);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy