Class NamespaceBeanLikeMapImpl

java.lang.Object
org.glassfish.hk2.xml.internal.NamespaceBeanLikeMapImpl
All Implemented Interfaces:
Serializable, NamespaceBeanLikeMap

public class NamespaceBeanLikeMapImpl extends Object implements NamespaceBeanLikeMap, Serializable
Author:
jwells
See Also:
  • Constructor Details

    • NamespaceBeanLikeMapImpl

      public NamespaceBeanLikeMapImpl()
  • Method Details

    • getValue

      public Object getValue(String namespace, String key)
      Description copied from interface: NamespaceBeanLikeMap
      Gets the value for key based on the namespace. Locking must be done by the caller
      Specified by:
      getValue in interface NamespaceBeanLikeMap
      Parameters:
      namespace - if null or the empty string the default namespace will be used
      key - the non-null key
      Returns:
      The value if found (may be null) or null if not set (use NamespaceBeanLikeMap.isSet(String, String) to determine if a value has been set
    • setValue

      public void setValue(String namespace, String key, Object value)
      Description copied from interface: NamespaceBeanLikeMap
      Sets the value for key based on the namespace. Locking must be done by the caller
      Specified by:
      setValue in interface NamespaceBeanLikeMap
      Parameters:
      namespace - if null or the empty string the default namespace will be used
      key - the non-null key
      value - The value to set this key to (may be null)
    • isSet

      public boolean isSet(String namespace, String key)
      Description copied from interface: NamespaceBeanLikeMap
      Determines if the value for key based on namespace has been explicitly set. Locking must be done by the caller
      Specified by:
      isSet in interface NamespaceBeanLikeMap
      Parameters:
      namespace - if null or the empty string the default namespace will be used
      key - the non-null key
      Returns:
      true if the value is explicitly set, false otherwise
    • backup

      public void backup()
      Description copied from interface: NamespaceBeanLikeMap
      Create a backup of all namespaces at this point. Locking must be done by the caller
      Specified by:
      backup in interface NamespaceBeanLikeMap
    • restoreBackup

      public void restoreBackup(boolean drop)
      Description copied from interface: NamespaceBeanLikeMap
      Either drop the backup data or restore the current data to the backup. Locking must be done by the caller
      Specified by:
      restoreBackup in interface NamespaceBeanLikeMap
      Parameters:
      drop - if true the backup should be dropped, if false the current data should be made the same as the backup
    • getBeanLikeMap

      public Map<String,Object> getBeanLikeMap(Map<String,String> namespaceToPrefixMap)
      Description copied from interface: NamespaceBeanLikeMap
      Gets the bean-like map given the set of prefixes to use for the various namespaces. Note that if a namespace is not found in the map the values from that namespace will not be included in the returned map. Locking must be handled by the caller
      Specified by:
      getBeanLikeMap in interface NamespaceBeanLikeMap
      Parameters:
      namespaceToPrefixMap - A map from namespace to the prefix that should be put on the keys for the namespace
      Returns:
      A map with the fully qualified bean-like names
    • shallowCopy

      public void shallowCopy(NamespaceBeanLikeMap copyFrom, ModelImpl copyModel, boolean copyReferences)
      Description copied from interface: NamespaceBeanLikeMap
      Does a shallow copy from another namespace bean-like map to this one
      Specified by:
      shallowCopy in interface NamespaceBeanLikeMap
      Parameters:
      copyFrom - The other namesapce bean-like map to copy
      copyModel - The model to use to determine what fields to copy
      copyReferences - true if references should also be copied
    • getNamespaceBeanLikeMap

      public Map<String,Map<String,Object>> getNamespaceBeanLikeMap()
      Description copied from interface: NamespaceBeanLikeMap
      Gets a raw copy of the bean-like map. The outer map has namespace keys (including one for default) and the inner map is the bean-like map for that namespace. The map returned is not a copy, so any changes to it will affect the underlying object (so don't change it)
      Specified by:
      getNamespaceBeanLikeMap in interface NamespaceBeanLikeMap
      Returns:
    • getQNameMap

      public Map<QName,Object> getQNameMap()
      Description copied from interface: NamespaceBeanLikeMap
      Gets a map from QName to value. Default namespace is not taken into account
      Specified by:
      getQNameMap in interface NamespaceBeanLikeMap
      Returns:
      A non-null map from QName to value
    • toString

      public String toString()
      Overrides:
      toString in class Object