Overview | Package | Class | Use | Tree | Help
| HEADER
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.developmentontheedge.application
Class Preferences

public class Preferences
implements DynamicPropertySet

Specialized implimentation of DynamicPropertySet to store and edit application preferences. Methods get/setValue, getProperty, getType, getPropertyDescriptor uses findProperty method that supports access to internal properties in preferences tree. The property name format is following: [parent/]*child

pending stored property can be only one of the allowed type: String, Boolean, Int, Long, Float, Double, Preferences (this allows to organise preferences in tree structure).

Inner Class Summary
`public static class` | Preferences.PropertyComparator

Constructor Summary
`Preferences()`

Method Summary
`void` | `add(DynamicProperty property)` Adds the specified property.
`void` | `addPropertyChangeListener(PropertyChangeListener listener)`
`void` | `addPropertyChangeListener(String propertyName, PropertyChangeListener listener)`
`Map` | `asMap()`
`boolean` | `contains(DynamicProperty property)` Checks if property does exist in this set
`void` | `firePropertyChange(String propertyName, Object oldValue, Object newValue)`
`void` | `firePropertyChange(PropertyChangeEvent evt)`
`boolean` | `getBooleanValue(String name, boolean defaultValue)`
`double` | `getDoubleValue(String name, double defaultValue)`
`float` | `getFloatValue(String name, float defaultValue)`
`int` | `getIntValue(String name, int defaultValue)`
`long` | `getLongValue(String name, long defaultValue)`
`DynamicProperty` | `getProperty(String name)`
`PropertyDescriptor` | `getPropertyDescriptor(String name)`
`String` | `getStringValue(String name, String defaultValue)`
`Class` | `getType(String name)`
`Object` | `getValue(String name)`
`Object` | `getValue(String name, Object defaultValue)`
`boolean` | `hasListeners(String propertyName)` Check if there are any listeners for a specific property.
`void` | `load(String fileName)`
`Iterator` | `nameIterator()`
`Iterator` | `propertyIterator()`
`boolean` | `remove(String name)`
`void` | `removePropertyChangeListener(PropertyChangeListener listener)`
`void` | `removePropertyChangeListener(String propertyName, PropertyChangeListener listener)`
`void` | `setValue(String name, Object value)` Set up value for the specified property name.
`void` | `setValue(String name, Object value, PropertyDescriptor descriptor)`

Constructor Detail

### Preferences

    public Preferences()

Method Detail

### add

    public void add(DynamicProperty property)

  Adds the specified property.

### addPropertyChangeListener

    public void addPropertyChangeListener(PropertyChangeListener listener)

### addPropertyChangeListener

    public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)

### asMap

    public Map asMap()

### contains

    public boolean contains(DynamicProperty property)

  Checks if property does exist in this set

### firePropertyChange

    public void firePropertyChange(String propertyName, Object oldValue, Object newValue)

### firePropertyChange

    public void firePropertyChange(PropertyChangeEvent evt)

### getBooleanValue

    public boolean getBooleanValue(String name, boolean defaultValue)

### getDoubleValue

    public double getDoubleValue(String name, double defaultValue)

### getFloatValue

    public float getFloatValue(String name, float defaultValue)

### getIntValue

    public int getIntValue(String name, int defaultValue)

### getLongValue

    public long getLongValue(String name, long defaultValue)

### getProperty

    public DynamicProperty getProperty(String name)

### getPropertyDescriptor

    public PropertyDescriptor getPropertyDescriptor(String name)

### getStringValue

    public String getStringValue(String name, String defaultValue)

### getType

    public Class getType(String name)

  Returns: type for the property with specified name.

### getValue

    public Object getValue(String name)

  Returns: value for the property with specified name.

### getValue

    public Object getValue(String name, Object defaultValue)

  Returns: value for the property with specified name.

### hasListeners

    public boolean hasListeners(String propertyName)

  Check if there are any listeners for a specific property.
  Parameters:
    propertyName - the property name.
  Returns: true if there are ore or more listeners for the given property

### load

    public void load(String fileName)

### nameIterator

    public Iterator nameIterator()

### propertyIterator

    public Iterator propertyIterator()

### remove

    public boolean remove(String name)

### removePropertyChangeListener

    public void removePropertyChangeListener(PropertyChangeListener listener)

### removePropertyChangeListener

    public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)

### setValue

    public void setValue(String name, Object value)

  Set up value for the specified property name.
  throw IllegalArgumentException if property with specified name was not found.
  pending firePropertyChange

### setValue

    public void setValue(String name, Object value, PropertyDescriptor descriptor)

Association Links

to Class java.beans.PropertyChangeSupport

to Class java.util.Map

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

Overview | Package | Class | Use | Tree | Help
| FOOTER
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

BOTTOM