|
|
|
@ -5,8 +5,6 @@ import static java.util.Collections.singletonMap;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.FileWriter;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import javax.xml.bind.JAXBException;
|
|
|
|
|
import javax.xml.transform.stream.StreamResult;
|
|
|
|
@ -15,8 +13,6 @@ import org.apache.sis.xml.MarshallerPool;
|
|
|
|
|
import org.apache.sis.xml.XML;
|
|
|
|
|
import org.opengis.metadata.Metadata;
|
|
|
|
|
|
|
|
|
|
import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
|
|
|
|
|
|
|
|
|
|
import lombok.Synchronized;
|
|
|
|
|
|
|
|
|
|
public class ISOMetadataMarshalling {
|
|
|
|
@ -45,30 +41,5 @@ public class ISOMetadataMarshalling {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static class Mapper extends NamespacePrefixMapper {
|
|
|
|
|
|
|
|
|
|
private Map<String, String> namespaceMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create mappings.
|
|
|
|
|
*/
|
|
|
|
|
public Mapper() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespaceMap.put("http://www.w3.org/2001/XMLSchema-instance", "xsi");
|
|
|
|
|
namespaceMap.put("https://www.intertech.com/software-consulting-services/", "consult");
|
|
|
|
|
namespaceMap.put("http://www.w3.org/2003/05/soap-envelope/", "soap");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* (non-Javadoc)
|
|
|
|
|
* Returning null when not found based on spec.
|
|
|
|
|
* @see com.sun.xml.bind.marshaller.NamespacePrefixMapper#getPreferredPrefix(java.lang.String, java.lang.String, boolean)
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) {
|
|
|
|
|
return namespaceMap.getOrDefault(namespaceUri, suggestion);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|