Class QNameMap<K,​V>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map

    public class QNameMap<K,​V>
    extends java.lang.Object
    implements java.util.Map, java.lang.Cloneable, java.io.Serializable
    A Map that holds as it's key a QName stored in it's internal String representation. Calls to get and put automatically map the key to and from the QName representation.
    Author:
    gavinc
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      java.lang.Object clone()
      Shallow copy the map by copying keys and values into a new QNameMap
      boolean containsKey​(java.lang.Object key)  
      boolean containsValue​(java.lang.Object value)  
      java.util.Set entrySet()  
      java.lang.Object get​(java.lang.Object key)  
      java.util.Map<QName,​V> getMapOfQNames()  
      protected NamespacePrefixResolver getResolver()
      Helper to return a NamespacePrefixResolver instance - should -always- be used rather than holding onto a reference on the heap.
      boolean isEmpty()  
      java.util.Set<java.lang.String> keySet()  
      java.lang.Object put​(java.lang.Object key, java.lang.Object value)  
      void putAll​(java.util.Map t)  
      java.lang.Object remove​(java.lang.Object key)  
      int size()  
      java.lang.String toString()
      Override Object.toString() to provide useful debug output
      java.util.Collection values()  
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Field Detail

      • logger

        protected static org.apache.commons.logging.Log logger
      • contents

        protected java.util.Map<java.lang.String,​java.lang.Object> contents
    • Constructor Detail

      • QNameMap

        public QNameMap​(NamespacePrefixResolverProvider provider)
        Constructor
        Parameters:
        provider - Mandatory NamespacePrefixResolverProvider helper
      • QNameMap

        protected QNameMap()
        Constructor for Serialization mechanism
    • Method Detail

      • getResolver

        protected final NamespacePrefixResolver getResolver()
        Helper to return a NamespacePrefixResolver instance - should -always- be used rather than holding onto a reference on the heap.
        Returns:
        NamespacePrefixResolver
      • size

        public final int size()
        Specified by:
        size in interface java.util.Map<K,​V>
        See Also:
        Map.size()
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Map<K,​V>
        See Also:
        Map.isEmpty()
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<K,​V>
        See Also:
        Map.containsKey(java.lang.Object)
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        Specified by:
        containsValue in interface java.util.Map<K,​V>
        See Also:
        Map.containsValue(java.lang.Object)
      • get

        public java.lang.Object get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<K,​V>
        See Also:
        Map.get(java.lang.Object)
      • put

        public java.lang.Object put​(java.lang.Object key,
                                    java.lang.Object value)
        Specified by:
        put in interface java.util.Map<K,​V>
        See Also:
        Map.put(Object, Object)
      • remove

        public java.lang.Object remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<K,​V>
        See Also:
        Map.remove(java.lang.Object)
      • putAll

        public void putAll​(java.util.Map t)
        Specified by:
        putAll in interface java.util.Map<K,​V>
        See Also:
        Map.putAll(java.util.Map)
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Map<K,​V>
        See Also:
        Map.clear()
      • keySet

        public java.util.Set<java.lang.String> keySet()
        Specified by:
        keySet in interface java.util.Map<K,​V>
        See Also:
        Map.keySet()
      • values

        public java.util.Collection values()
        Specified by:
        values in interface java.util.Map<K,​V>
        See Also:
        Map.values()
      • entrySet

        public java.util.Set entrySet()
        Specified by:
        entrySet in interface java.util.Map<K,​V>
        See Also:
        Map.entrySet()
      • toString

        public java.lang.String toString()
        Override Object.toString() to provide useful debug output
        Overrides:
        toString in class java.lang.Object
      • clone

        public java.lang.Object clone()
        Shallow copy the map by copying keys and values into a new QNameMap
        Overrides:
        clone in class java.lang.Object
      • getMapOfQNames

        public java.util.Map<QName,​V> getMapOfQNames()