public class

SimplePropertyManager

extends EventSource
implements IPropertyManager
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.events.EventSource
     ↳ com.pnfsoftware.jeb.core.properties.impl.SimplePropertyManager

Class Overview

A simple implementation of a IPropertyManager that does not use a PDM.

Summary

[Expand]
Inherited Constants
From interface com.pnfsoftware.jeb.core.properties.IPropertyManager
Public Constructors
SimplePropertyManager(IConfiguration config)
Public Methods
void dispose()
Release resources used by this manager.
boolean getBoolean(String name, boolean defaultOnNull)
Safely retrieve a boolean property.
boolean getBoolean(String name)
Safely retrieve a boolean property.
Boolean getBooleanUnsafe(String name)
Retrieve a boolean property.
IConfiguration getConfiguration()
Get the configuration object.
int getInteger(String name)
Safely retrieve an integer property.
int getInteger(String name, int defaultOnNull)
Safely retrieve an integer property.
Integer getIntegerUnsafe(String name)
Retrieve an integer property.
IPropertyDefinitionManager getPropertyDefinitionManager()
Get the PDM.
String getString(String name)
Safely retrieve a string property.
String getString(String name, String defaultOnNull)
Safely retrieve a string property.
String getStringUnsafe(String name)
Retrieve a string property.
Object getValue(String name)
Get a property value.
Object getValue(String name, int checkingDepth, boolean validateValue)
Get a property value with optional control on depth search and property validation.
boolean setBoolean(String name, Boolean value)
Set a boolean property.
boolean setBoolean(String name, Boolean value, PropertyChangeObject co)
boolean setInteger(String name, Integer value, PropertyChangeObject co)
boolean setInteger(String name, Integer value)
Set an integer property value
boolean setString(String name, String value, PropertyChangeObject co)
boolean setString(String name, String value)
Get a string property value.
boolean setValue(String name, Object value)
Set a property value.
boolean setValue(String name, Object value, boolean validateValue, PropertyChangeObject co)
Set a property value with optional control on property validation.
[Expand]
Inherited Methods
From class com.pnfsoftware.jeb.util.events.EventSource
From class java.lang.Object
From interface com.pnfsoftware.jeb.core.properties.IPropertyManager
From interface com.pnfsoftware.jeb.util.events.IEventSource

Public Constructors

public SimplePropertyManager (IConfiguration config)

Public Methods

public void dispose ()

Release resources used by this manager.

public boolean getBoolean (String name, boolean defaultOnNull)

Safely retrieve a boolean property.

public boolean getBoolean (String name)

Safely retrieve a boolean property. On error, false is returned.

Parameters
name the property name
Returns
  • the property value

public Boolean getBooleanUnsafe (String name)

Retrieve a boolean property. This method may throw or return null.

public IConfiguration getConfiguration ()

Get the configuration object.

Returns
  • the configuration object

public int getInteger (String name)

Safely retrieve an integer property. On error, zero is returned.

Parameters
name the property name
Returns
  • the property value

public int getInteger (String name, int defaultOnNull)

Safely retrieve an integer property.

public Integer getIntegerUnsafe (String name)

Retrieve an integer property. This method may throw or return null.

public IPropertyDefinitionManager getPropertyDefinitionManager ()

Get the PDM. Implementations may not provide a definition manager.

Returns
  • the PDM, null if none

public String getString (String name)

Safely retrieve a string property. On error, the empty string is returned.

Parameters
name the property name
Returns
  • the property value

public String getString (String name, String defaultOnNull)

Safely retrieve a string property.

public String getStringUnsafe (String name)

Retrieve a string property.

public Object getValue (String name)

Get a property value.

Parameters
name the property name
Returns
  • the property value

public Object getValue (String name, int checkingDepth, boolean validateValue)

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.

Parameters
name the property name
checkingDepth one of the DEPTH_* constant
validateValue validate the property value against its definition
Returns
  • the property value object (Boolean, Integer, or String), null on error

public boolean setBoolean (String name, Boolean value)

Set a boolean property.

Parameters
name the property name
value the property value

public boolean setBoolean (String name, Boolean value, PropertyChangeObject co)

public boolean setInteger (String name, Integer value, PropertyChangeObject co)

public boolean setInteger (String name, Integer value)

Set an integer property value

Parameters
name the property name
value the property value

public boolean setString (String name, String value, PropertyChangeObject co)

public boolean setString (String name, String value)

Get a string property value.

Parameters
name the property name
value the property value

public boolean setValue (String name, Object value)

Set a property value.

Parameters
name the property name
value the property value
Returns
  • true on success

public boolean setValue (String name, Object value, boolean validateValue, PropertyChangeObject co)

Set a property value with optional control on property validation. By default, property setters validate values.

Parameters
name the property name
value the property value
validateValue validate the property value against its definition
Returns
  • true on success