@NotThreadSafe public class MapBasedNamespaceContext extends AbstractNamespaceContext implements com.helger.commons.lang.ICloneable<MapBasedNamespaceContext>
| Constructor and Description |
|---|
MapBasedNamespaceContext()
Default constructor.
|
MapBasedNamespaceContext(IIterableNamespaceContext aOther)
Constructor to copy from another
IIterableNamespaceContext |
MapBasedNamespaceContext(Map<String,String> aOther)
Constructor with prefix to namespace URL map
|
MapBasedNamespaceContext(MapBasedNamespaceContext aOther)
Copy constructor.
|
getNamespaceURI, getPrefix, getPrefixespublic MapBasedNamespaceContext()
public MapBasedNamespaceContext(@Nullable MapBasedNamespaceContext aOther)
aOther - Object to copy from. May be null.public MapBasedNamespaceContext(@Nullable IIterableNamespaceContext aOther)
IIterableNamespaceContextaOther - Object to copy the data from. May be null.@Nullable public String getDefaultNamespaceURI()
getDefaultNamespaceURI in class AbstractNamespaceContext@Nonnull public final MapBasedNamespaceContext addMapping(@Nonnull String sPrefix, @Nonnull String sNamespaceURI)
sPrefix - The prefix to be used. May not be null. If it equals
XMLConstants.DEFAULT_NS_PREFIX that the namespace is
considered to be the default one.sNamespaceURI - The namespace URI to be mapped. May not be null but
maybe empty.IllegalArgumentException - If another mapping for the passed prefix is already presentsetMapping(String, String)@Nonnull public final MapBasedNamespaceContext setMapping(@Nonnull String sPrefix, @Nonnull String sNamespaceURI)
sPrefix - The prefix to be used. May not be null. If it equals
XMLConstants.DEFAULT_NS_PREFIX that the namespace is
considered to be the default one.sNamespaceURI - The namespace URI to be mapped. May not be null but
maybe empty.addMapping(String, String)@Nonnull public final MapBasedNamespaceContext addMappings(@Nullable IIterableNamespaceContext aOther)
@Nonnull public final MapBasedNamespaceContext setMappings(@Nullable IIterableNamespaceContext aOther)
@Nonnull public final MapBasedNamespaceContext addMappings(@Nullable Map<String,String> aOther)
@Nonnull public final MapBasedNamespaceContext setMappings(@Nullable Map<String,String> aOther)
@Nonnull public final MapBasedNamespaceContext addDefaultNamespaceURI(@Nonnull String sNamespaceURI)
sNamespaceURI - The namespace URI to be used as the default. May not be
null but maybe empty.@Nonnull public final MapBasedNamespaceContext setDefaultNamespaceURI(@Nonnull String sNamespaceURI)
sNamespaceURI - The namespace URI to be used as the default. May not be
null but maybe empty.@Nonnull public com.helger.commons.state.EChange removeMapping(@Nullable String sPrefix)
@Nonnull public com.helger.commons.state.EChange clear()
@Nullable public Iterator<String> getCustomPrefixes(@Nonnull String sNamespaceURI)
getCustomPrefixes in class AbstractNamespaceContext@Nullable public String getCustomPrefix(@Nonnull String sNamespaceURI)
getCustomPrefix in class AbstractNamespaceContext@Nullable public String getCustomNamespaceURI(@Nonnull String sPrefix)
getCustomNamespaceURI in class AbstractNamespaceContext@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> getPrefixToNamespaceURIMap()
IIterableNamespaceContextgetPrefixToNamespaceURIMap in interface IIterableNamespaceContextpublic boolean hasAnyMapping()
@Nonnegative public int getMappingCount()
@Nonnull @ReturnsMutableCopy public MapBasedNamespaceContext getClone()
getClone in interface com.helger.commons.lang.ICloneable<MapBasedNamespaceContext>Copyright © 2014–2018 Philip Helger. All rights reserved.