/** Add the bindings in the prefixToURI to our own. This will fail with a ClassCastException if any key or value is not a String; we make no guarantees about order or completeness if this happens. It will fail with an IllegalPrefixException if any prefix is illegal; similar provisos apply. @param other the Map whose bindings we are to add to this. */ @Override public PrefixMapping setNsPrefixes( Map<String, String> other ) { checkUnlocked(); for (Entry<String, String> e: other.entrySet()) setNsPrefix( e.getKey(), e.getValue() ); return this; }
/** Answer this PrefixMapping after updating it with the <code>(p, u)</code> mappings in <code>other</code> where neither <code>p</code> nor <code>u</code> appear in this mapping. */ @Override public PrefixMapping withDefaultMappings( PrefixMapping other ) { checkUnlocked(); for (Entry<String, String> e: other.getNsPrefixMap().entrySet()) { String prefix = e.getKey(), uri = e.getValue(); if (getNsPrefixURI( prefix ) == null && getNsURIPrefix( uri ) == null) setNsPrefix( prefix, uri ); } return this; }