Class FWPropertyContainer

java.lang.Object
net.simplace.core.property.FWPropertyContainer

public class FWPropertyContainer extends Object
A named property set (key to value), stored as XML element properties.
Author:
Andreas Enders
  • Constructor Details

    • FWPropertyContainer

      public FWPropertyContainer(String aID, Map<String,Object> aParameterMap)
      Parameters:
      aID - name of the property set
      aParameterMap - the properties (used directly, not copied)
    • FWPropertyContainer

      public FWPropertyContainer(FWObservable aObservable)
      Creates the container from the parameters of an observable; the name is its system id.
      Parameters:
      aObservable - the observable (its parameter map is used directly)
    • FWPropertyContainer

      public FWPropertyContainer(String aID, org.jdom2.Element aPropertiesJDOMElement)
      Parameters:
      aID - name of the property set
      aPropertiesJDOMElement - the XML element with the properties
    • FWPropertyContainer

      public FWPropertyContainer(String aID)
      Creates an empty container.
      Parameters:
      aID - name of the property set
  • Method Details

    • serialize

      public org.jdom2.Element serialize()
      Returns:
      the properties as XML element properties
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      the properties as XML text, or an empty string on errors (logged)
    • getObservable

      public FWObservable getObservable()
      Note: SYSTEM_ID is added to the properties.
      Returns:
      a new observable working on the live property map, with the name as SYSTEM_ID
    • getStringParameterValue

      public String getStringParameterValue(String aKey)
      Parameters:
      aKey - the property key
      Returns:
      the property value as string, or null if not set
    • getParameter

      public Object getParameter(String aKey)
      Parameters:
      aKey - the property key, see FWFrameworkHelper.getParameterFromMap(Map, String, Object)
      Returns:
      the property value, or null
    • setParameterValue

      public void setParameterValue(String aKey, Object aValue)
      Sets a property.
      Parameters:
      aKey - the property key
      aValue - the value; null is ignored
    • setParameterMap

      public void setParameterMap(Map<String,Object> aKeyValueMap)
      Sets all properties of a map, see setParameterValue(String, Object).
      Parameters:
      aKeyValueMap - the properties to set
    • getID

      public String getID()
      Returns:
      the name of the property set