diff options
author | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-05-08 13:41:27 +0200 |
---|---|---|
committer | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-05-08 13:41:27 +0200 |
commit | 6f450a1d3ff60557b1081f9e8ef6bd5f375db842 (patch) | |
tree | 336068552025782ec3f9716999fb3c391fbed9ea /src/main/java/at/gv/egiz/moazs/MoaZSPrefixMapper.java | |
parent | 36fd031d1f0218e323b50e6d63eff4a7cee99cd7 (diff) | |
download | moa-zs-6f450a1d3ff60557b1081f9e8ef6bd5f375db842.tar.gz moa-zs-6f450a1d3ff60557b1081f9e8ef6bd5f375db842.tar.bz2 moa-zs-6f450a1d3ff60557b1081f9e8ef6bd5f375db842.zip |
Refactor: Consolidate Schema-Related Components
Diffstat (limited to 'src/main/java/at/gv/egiz/moazs/MoaZSPrefixMapper.java')
-rw-r--r-- | src/main/java/at/gv/egiz/moazs/MoaZSPrefixMapper.java | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/MoaZSPrefixMapper.java b/src/main/java/at/gv/egiz/moazs/MoaZSPrefixMapper.java deleted file mode 100644 index ef85989..0000000 --- a/src/main/java/at/gv/egiz/moazs/MoaZSPrefixMapper.java +++ /dev/null @@ -1,54 +0,0 @@ -package at.gv.egiz.moazs; - -import com.sun.xml.bind.marshaller.NamespacePrefixMapper; -import org.springframework.stereotype.Component; - -import java.util.HashMap; -import java.util.Map; - -@Component -public class MoaZSPrefixMapper extends NamespacePrefixMapper { - - private final Map<String, String> map = new HashMap<>(); - - public MoaZSPrefixMapper() { - map.put(getMsgNamespaceUri(), "msg"); - map.put(getMsgPNamespaceUri(), "msgp"); - map.put(getMzsNamespaceUri(), "mzs"); - map.put(getMzsPNamespaceUri(), "mzsp"); - map.put(getDsigNamespaceUri(), "dsig"); - } - - public MoaZSPrefixMapper(boolean isMzs) { - this(); - map.put((isMzs) ? getMzsPNamespaceUri() : getMsgPNamespaceUri(), "p"); - map.put((isMzs) ? getMzsNamespaceUri() : getMsgNamespaceUri(), ""); - } - - @Override - public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) { - return map.getOrDefault(namespaceUri, suggestion); - } - - private String getMsgNamespaceUri() { - return new at.gv.zustellung.msg.xsd.ObjectFactory().createDeliveryRequest(null).getName().getNamespaceURI(); - } - - private String getMsgPNamespaceUri() { - return new at.gv.zustellung.msg.xsd.persondata.ObjectFactory().createPerson(null).getName().getNamespaceURI(); - } - - private String getMzsNamespaceUri() { - return new at.gv.zustellung.app2mzs.xsd.ObjectFactory().createDeliveryRequest(null).getName().getNamespaceURI(); - } - - private String getMzsPNamespaceUri() { - return new at.gv.zustellung.app2mzs.xsd.persondata.ObjectFactory().createAbstractPersonData(null).getName().getNamespaceURI(); - } - - private String getDsigNamespaceUri() { - return new org.w3._2000._09.xmldsig_.ObjectFactory().createCanonicalizationMethod(null).getName().getNamespaceURI(); - } - - -} |