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

## com.togethersoft.openapi.util.propertyMap
Interface PropertyMap

All Known Implementing Classes:
  DefaultPropertyMap, SwitchablePropertyMap

public interface PropertyMap

Provides a flexibile mechanism for working with object's properties. A property for this interface is a key-value pair with both key and value of `Object` type. It is possible to have one-to-many relationships between a key and a value. To assign a listener to any property, use the `addPropertyMapListener` method.

Author:
  TogetherSoft

Method Summary
`Property` | `addProperty(Object propertyKey, Object propertyValue)` Adds a property with the specified value to the properties set.
`void` | `addPropertyMapListener(Object propertyKey, PropertyMapListener listener)` Adds a listener to the specified property.
`boolean` | `canAddProperty(Object propertyKey, Object propertyValue)` Checks whether a property with the specified value can be added to the properties set.
`boolean` | `canSetPropertyValue(Object propertyKey, Object propertyValue)` Checks whether the specified value can be set for the property.
`Object` | `getPropertyValue(Object propertyKey)` Returns a value of the property.
`Object` | `getPropertyValue(Object propertyKey, Class valueClass)` Returns a value of the property as a specified class instance.
`boolean` | `isPropertyReadable(Object propertyKey)` Checks whether the property is readable.
`boolean` | `isPropertyWritable(Object propertyKey)` Checks whether the property is writable.
`Enumeration` | `properties()` Returns an enumeration of all properties containded in this PropertyMap.
`Enumeration` | `properties(Object propertyKey)` Returns an enumeration of all properties with the same key value containded in this PropertyMap.
`void` | `removePropertyMapListener(Object propertyKey, PropertyMapListener listener)` Removes a listener of the specified property.
`void` | `setPropertyValue(Object propertyKey, Object propertyValue)` Sets a value for the specified property.

Method Detail

### addProperty

    public Property addProperty(Object propertyKey, Object propertyValue)

  Adds a property with the specified value to the properties set.
  Parameters:
    propertyKey - a key object
    propertyValue - a value which needs to be set
  Returns: a new just created property.
  See Also:
    Property

### addPropertyMapListener

    public void addPropertyMapListener(Object propertyKey, PropertyMapListener listener)

  Adds a listener to the specified property.
  Parameters:
    propertyKey - a key object
    listener - a `PropertyMapListener` object
  See Also:
    PropertyMapListener

### canAddProperty

    public boolean canAddProperty(Object propertyKey, Object propertyValue)

  Checks whether a property with the specified value can be added to the properties set.
  Parameters:
    propertyKey - a key object
    propertyValue - a value which needs to be set
  Returns: `true` if a property with the specified value can be added to the properties set, `false` otherwise

### canSetPropertyValue

    public boolean canSetPropertyValue(Object propertyKey, Object propertyValue)

  Checks whether the specified value can be set for the property.
  Parameters:
    propertyKey - a key object
    propertyValue - a value which needs to be set
  Returns: `true` if the specified value can be set as a value for the property, `false` otherwise

### getPropertyValue

    public Object getPropertyValue(Object propertyKey)

  Returns a value of the property.
  Parameters:
    propertyKey - a key object
  Returns: a value of the property

### getPropertyValue

    public Object getPropertyValue(Object propertyKey, Class valueClass)
                             throws CastNotSupportedException

  Returns a value of the property as a specified class instance.
  Parameters:
    propertyKey - a key object
    valueClass - a class (superclass) of a value of the property
  Returns: a value of the property
  Throws:
    CastNotSupportedException - If class of a value of this property is not a subclass or the same class that the specified class

### isPropertyReadable

    public boolean isPropertyReadable(Object propertyKey)

  Checks whether the property is readable.
  Parameters:
    propertyKey - a key object
  Returns: `true` if the property is readable, `false` otherwise

### isPropertyWritable

    public boolean isPropertyWritable(Object propertyKey)

  Checks whether the property is writable.
  Parameters:
    propertyKey - a key object
  Returns: `true` if the property is writable, `false` otherwise

### properties

    public Enumeration properties()

  Returns an enumeration of all properties containded in this PropertyMap.
  Returns: an enumeration of all properties containded in this PropertyMap

### properties

    public Enumeration properties(Object propertyKey)

  Returns an enumeration of all properties with the same key value containded in this PropertyMap.
  Returns: an enumeration of all properties with the same key value containded in this PropertyMap

### removePropertyMapListener

    public void removePropertyMapListener(Object propertyKey, PropertyMapListener listener)

  Removes a listener of the specified property.
  Parameters:
    propertyKey - a key object
    listener - a `PropertyMapListener` object
  See Also:
    PropertyMapListener

### setPropertyValue

    public void setPropertyValue(Object propertyKey, Object propertyValue)

  Sets a value for the specified property.
  Parameters:
    propertyKey - a key object
    propertyValue - a value which needs to be set

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