/** * Returns the old namespace for elements (types and properties) in the given namespace. * This method is used only for default relocations, i.e. the fallback to apply when no * explicit rule has been found. */ @Override final String relocate(final String namespace) { return version.exportNS(namespace); }
/** * Returns the namespace for the given prefix. The same URI may be returned for many prefixes. * For example when exporting from ISO 19115-3:2016 to legacy ISO 19139:2007, the {@code "mdb"}, * {@code "cit"} and many other prefixes are all mapped to {@code "http://www.isotc211.org/2005/gmd"}. * This is legal according {@link NamespaceContext} javadoc. */ @Override public String getNamespaceURI(final String prefix) { return version.exportNS(context.getNamespaceURI(prefix)); }
/** * Returns all prefixes for the given namespace. There is usually only one, contrarily * to {@link TransformingNamespaces#getPrefixes(String)} which have many. * * <p>This is a <cite>surjective</cite> function: * many prefixes can be created from the same namespace.</p> */ @Override public Iterator<String> getPrefixes(final String namespaceURI) { return context.getPrefixes(version.exportNS(namespaceURI)); } }
/** * Returns an arbitrary prefix for the given namespace. For example given the * {@code "http://standards.iso.org/iso/19115/-3/mdb/1.0"} namespace from ISO 19115-3, * this method returns {@code "gmd"} which was the prefix used in legacy ISO 19139:2007. * * <p>This is a <cite>surjective</cite> function: * many prefixes can be created from the same namespace.</p> */ @Override public String getPrefix(final String namespaceURI) { return context.getPrefix(version.exportNS(namespaceURI)); }
/** * Gets the URI used in the XML document for the given prefix used in JAXB annotations. * At marshalling time, events are created by JAXB using namespaces used in JAXB annotations. * {@link TransformingWriter} wraps those events for converting those namespaces to the ones used * in the XML document. * * <div class="note"><b>Example:</b> the {@code "cit"} prefix from ISO 19115-3:2016 standard * represents the {@code "http://standards.iso.org/iso/19115/-3/mdb/1.0"} namespace, which is * mapped to {@code "http://www.isotc211.org/2005/gmd"} in the legacy ISO 19139:2007 standard. * That later URI is returned.</div> */ @Override public String getNamespaceURI(final String prefix) { return version.exportNS(event.getNamespaceURI(prefix)); }