Class SimplePropertyManager

java.lang.Object
com.pnfsoftware.jeb.util.events.EventSource
com.pnfsoftware.jeb.core.properties.impl.SimplePropertyManager
All Implemented Interfaces:
IPropertyManager, IEventSource

public class SimplePropertyManager extends EventSource implements IPropertyManager
Simple implementation of a IPropertyManager that does not use a PDM.
  • Constructor Details

    • SimplePropertyManager

      public SimplePropertyManager(IConfiguration config)
  • Method Details

    • dispose

      public void dispose()
      Description copied from interface: IPropertyManager
      Release resources used by this manager.
      Specified by:
      dispose in interface IPropertyManager
    • getConfiguration

      public IConfiguration getConfiguration()
      Description copied from interface: IPropertyManager
      Get the configuration object.
      Specified by:
      getConfiguration in interface IPropertyManager
      Returns:
      the configuration object
    • getPropertyDefinitionManager

      public IPropertyDefinitionManager getPropertyDefinitionManager()
      Description copied from interface: IPropertyManager
      Get the PDM. Implementations may not provide a definition manager.
      Specified by:
      getPropertyDefinitionManager in interface IPropertyManager
      Returns:
      the PDM, null if none
    • getBoolean

      public boolean getBoolean(String name)
      Description copied from interface: IPropertyManager
      Safely retrieve a boolean property. On error, false is returned.
      Specified by:
      getBoolean in interface IPropertyManager
      Parameters:
      name - property name
      Returns:
      success indicator
    • getBoolean

      public boolean getBoolean(String name, boolean defaultOnNull)
      Description copied from interface: IPropertyManager
      Safely retrieve a boolean property.
      Specified by:
      getBoolean in interface IPropertyManager
      Parameters:
      name - the property name
      Returns:
      success indicator
    • getBooleanUnsafe

      public Boolean getBooleanUnsafe(String name)
      Description copied from interface: IPropertyManager
      Retrieve a boolean property. This method may throw or return null.
      Specified by:
      getBooleanUnsafe in interface IPropertyManager
      Parameters:
      name - property name
      Returns:
    • getInteger

      public int getInteger(String name)
      Description copied from interface: IPropertyManager
      Safely retrieve an integer property. On error, zero is returned.

      Selection properties are integer properties.

      Specified by:
      getInteger in interface IPropertyManager
      Parameters:
      name - property name
      Returns:
      the property value
    • getInteger

      public int getInteger(String name, int defaultOnNull)
      Description copied from interface: IPropertyManager
      Safely retrieve an integer property.

      Selection properties are integer properties.

      Specified by:
      getInteger in interface IPropertyManager
      Parameters:
      name - property name
      Returns:
      the property value
    • getIntegerUnsafe

      public Integer getIntegerUnsafe(String name)
      Description copied from interface: IPropertyManager
      Retrieve an integer property. This method may throw or return null.

      Selection properties are integer properties.

      Specified by:
      getIntegerUnsafe in interface IPropertyManager
      Parameters:
      name - property name
      Returns:
      the property value
    • getString

      public String getString(String name)
      Description copied from interface: IPropertyManager
      Safely retrieve a string property. On error, the empty string is returned.
      Specified by:
      getString in interface IPropertyManager
      Parameters:
      name - property name
      Returns:
      the property value
    • getString

      public String getString(String name, String defaultOnNull)
      Description copied from interface: IPropertyManager
      Safely retrieve a string property.
      Specified by:
      getString in interface IPropertyManager
      Parameters:
      name - property name
      Returns:
      the property value
    • getStringUnsafe

      public String getStringUnsafe(String name)
      Description copied from interface: IPropertyManager
      Retrieve a string property.
      Specified by:
      getStringUnsafe in interface IPropertyManager
      Parameters:
      name - property name
      Returns:
      the property value
    • getValue

      public Object getValue(String name)
      Description copied from interface: IPropertyManager
      Get a property value. Same as getValue(name, DEPTH_FULL, true, true).
      Specified by:
      getValue in interface IPropertyManager
      Parameters:
      name - property name
      Returns:
      the property value
    • getValue

      public Object getValue(String name, int checkingDepth, boolean resolveDefault, boolean validateValue)
      Description copied from interface: IPropertyManager
      Get a property value with optional control on depth search and property validation. By default, property getters do a maximum depth search and validate values.
      Specified by:
      getValue in interface IPropertyManager
      Parameters:
      name - property name
      checkingDepth - one of the DEPTH_* constant
      resolveDefault - if the property has a definition, but does not have a value, the default value (as defined) would be returned instead of potentially null
      validateValue - if the property has a definition, validate the property value against its definition
      Returns:
      the property value object (an Object, Boolean, Integer, or String) or null
    • setBoolean

      public boolean setBoolean(String name, Boolean value)
      Description copied from interface: IPropertyManager
      Set a boolean property.
      Specified by:
      setBoolean in interface IPropertyManager
      Parameters:
      name - property name
      value - property value; null to remove the property
      Returns:
      success indicator
    • setBoolean

      public boolean setBoolean(String name, Boolean value, PropertyChangeObject co)
      Description copied from interface: IPropertyManager
      Set a boolean property.
      Specified by:
      setBoolean in interface IPropertyManager
      Parameters:
      name - property name
      value - the property value; null to remove the property
      co - optional change object; if present, the property is recorded into that object instead of the PM, and changes are committed to the PM only after calling PropertyChangeObject.commit()
      Returns:
      success indicator
    • setInteger

      public boolean setInteger(String name, Integer value)
      Description copied from interface: IPropertyManager
      Set an integer property.

      Selection properties are integer properties.

      Specified by:
      setInteger in interface IPropertyManager
      Parameters:
      name - property name
      value - property value; null to remove the property
      Returns:
      success indicator
    • setInteger

      public boolean setInteger(String name, Integer value, PropertyChangeObject co)
      Description copied from interface: IPropertyManager
      Set an integer property.

      Selection properties are integer properties.

      Specified by:
      setInteger in interface IPropertyManager
      Parameters:
      name - property name
      value - property value; null to remove the property
      co - optional change object; if present, the property is recorded into that object instead of the PM, and changes are committed to the PM only after calling PropertyChangeObject.commit()
      Returns:
      success indicator
    • setString

      public boolean setString(String name, String value)
      Description copied from interface: IPropertyManager
      Set a string property.
      Specified by:
      setString in interface IPropertyManager
      Parameters:
      name - the property name; null to remove the property
      value - the property value
    • setString

      public boolean setString(String name, String value, PropertyChangeObject co)
      Description copied from interface: IPropertyManager
      Set a string property.
      Specified by:
      setString in interface IPropertyManager
      Parameters:
      name - property name
      value - property value; null to remove the property
      co - optional change object; if present, the property is recorded into that object instead of the PM, and changes are committed to the PM only after calling PropertyChangeObject.commit()
      Returns:
      success indicator
    • setValue

      public boolean setValue(String name, Object value)
      Description copied from interface: IPropertyManager
      Set a property value.
      Specified by:
      setValue in interface IPropertyManager
      Parameters:
      name - property name
      value - property value; null to remove the property
      Returns:
      success indicator
    • setValue

      public boolean setValue(String name, Object value, boolean validateValue, PropertyChangeObject co)
      Description copied from interface: IPropertyManager
      Set a property value with optional control on property validation. By default, property setters validate values.
      Specified by:
      setValue in interface IPropertyManager
      Parameters:
      name - property name
      value - property value; null to remove the property
      validateValue - validate the property value against its definition
      co - (optional) if a change-object is provided, the changes will not be recorded to the manager, but added to the change-object itself; client can later commit all changes at once
      Returns:
      success indicator