Class SharedDefaults

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,​java.lang.String>

    public class SharedDefaults
    extends java.util.HashMap<java.lang.String,​java.lang.String>
    Processes the shared default values. Updates and Persists new key - value (default) pair
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

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

      Fields 
      Modifier and Type Field Description
      org.w3c.dom.Document document  
      static java.lang.String GET  
      static java.lang.String ResourceFolder
      Specifies the folder name present in the plugin
      static java.lang.String SET
      Static reference string for getting (GET) and storing (SET) shareddefaults.xml
    • Constructor Summary

      Constructors 
      Constructor Description
      SharedDefaults()
      Default Constructor for creating and instantiating objects.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addToBackEndStorage​(java.lang.String name, java.lang.String value)
      Adds data to the backend XML (persistence) Data obtained from the PreferencePage GUI.
      void deleteBackEndStorage​(java.lang.String[] deleteName)
      Deletes the key-value pair from the backend with Key as identifier.
      static SharedDefaults getInstance()  
      java.util.Map<java.lang.String,​java.lang.String> getSharedDefaultsMap()
      This method returns the latest key value pair (HashMap)
      void persistSharedValueMap()
      This method persists the latest data (HashMap) in the XML file New data obtained from the PreferencePage GUI.
      void updateShareDefaultsMap​(java.util.Map<java.lang.String,​java.lang.String> sharedMap)
      This method updates the HashMap with new key-value pair into the XML file
      void updateToBackEndStorage​(java.lang.String updateName, java.lang.String updateValue)
      Updates backend with changed value for a specific key(name)
      • Methods inherited from class java.util.HashMap

        clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

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

        equals, hashCode
    • Field Detail

      • document

        public org.w3c.dom.Document document
      • SET

        public static final java.lang.String SET
        Static reference string for getting (GET) and storing (SET) shareddefaults.xml
        See Also:
        Constant Field Values
      • ResourceFolder

        public static final java.lang.String ResourceFolder
        Specifies the folder name present in the plugin
        See Also:
        Constant Field Values
    • Constructor Detail

      • SharedDefaults

        public SharedDefaults()
        Default Constructor for creating and instantiating objects. On the startup of Template Engine, if it checks for the existence of TempSharedDefaultsXML file, then it is determined that the last Template Engine process under went some System destructive events and takes up reconstructive process to regain the consistent data by persisting all information first into temporary file and then into actual file.
    • Method Detail

      • getInstance

        public static SharedDefaults getInstance()
        Returns:
        the shared SharedDefaults Instance
      • updateShareDefaultsMap

        public void updateShareDefaultsMap​(java.util.Map<java.lang.String,​java.lang.String> sharedMap)
        This method updates the HashMap with new key-value pair into the XML file
        Parameters:
        sharedMap -
      • persistSharedValueMap

        public void persistSharedValueMap()
        This method persists the latest data (HashMap) in the XML file New data obtained from the PreferencePage GUI.
      • getSharedDefaultsMap

        public java.util.Map<java.lang.String,​java.lang.String> getSharedDefaultsMap()
        This method returns the latest key value pair (HashMap)
        Returns:
        HashMap
      • addToBackEndStorage

        public void addToBackEndStorage​(java.lang.String name,
                                        java.lang.String value)
        Adds data to the backend XML (persistence) Data obtained from the PreferencePage GUI.
      • updateToBackEndStorage

        public void updateToBackEndStorage​(java.lang.String updateName,
                                           java.lang.String updateValue)
        Updates backend with changed value for a specific key(name)
        Parameters:
        updateName -
        updateValue -
      • deleteBackEndStorage

        public void deleteBackEndStorage​(java.lang.String[] deleteName)
        Deletes the key-value pair from the backend with Key as identifier.
        Parameters:
        deleteName -