Interface NamespaceBeanLikeMap

All Known Implementing Classes:
NamespaceBeanLikeMapImpl

public interface NamespaceBeanLikeMap
Author:
jwells
  • Method Details

    • getValue

      Object getValue(String namespace, String key)
      Gets the value for key based on the namespace. Locking must be done by the caller
      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 isSet(String, String) to determine if a value has been set
    • setValue

      void setValue(String namespace, String key, Object value)
      Sets the value for key based on the namespace. Locking must be done by the caller
      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

      boolean isSet(String nanmespace, String key)
      Determines if the value for key based on namespace has been explicitly set. Locking must be done by the caller
      Parameters:
      nanmespace - 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

      void backup()
      Create a backup of all namespaces at this point. Locking must be done by the caller
    • restoreBackup

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

      Map<String,Object> getBeanLikeMap(Map<String,String> namespaceToPrefixMap)
      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
      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
    • getQNameMap

      Map<QName,Object> getQNameMap()
      Gets a map from QName to value. Default namespace is not taken into account
      Returns:
      A non-null map from QName to value
    • shallowCopy

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

      Map<String,Map<String,Object>> getNamespaceBeanLikeMap()
      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)
      Returns: