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
Class DefaultPropertyMap

public class DefaultPropertyMap
implements PropertyMap

`DefaultPropertyMap` class is a generic-use implementation of a `PropertyMap` interface. It provides the minimal functionality of all `PropertyMap`'s methods, but still enough for using it in many cases. To get a more sophisticated `PropertyMap` instance, one have to define its own class implementing `PropertyMap` interface.

Author:
  TogetherSoft

Inner Class Summary
`public class` | DefaultPropertyMap.DefaultProperty

Method Summary
`Property` | `addProperty(Object propertyKey, Object propertyValue)` Adds new property.
`void` | `addPropertyMapListener(Object propertyKey, PropertyMapListener listener)` Adds listener of PropertyMapEvent for certain property.
`protected void` | `addPropertyToEnd(DefaultProperty property)` Adds specified property to the end of property list.
`boolean` | `canAddProperty(Object propertyKey, Object propertyValue)` Checks whether it is possible to add specified property with specified value.
`boolean` | `canSetPropertyValue(Object propertyKey, Object propertyValue)` Checks whether it is possible to set specified value for specified property.
`protected DefaultProperty` | `createProperty(Object key, Object value)` Creates and returns a property with the specified key and value.
`protected void` | `fireEvent(PropertyMapEvent event)` Fires specified PropertyMapEvent.
`Object` | `getPropertyValue(Object propertyKey)` Return value of property with specified key.
`Object` | `getPropertyValue(Object propertyKey, Class valueClass)` Return value of property with specified key and class of value.
`boolean` | `isPropertyReadable(Object propertyKey)` Checks whether it is possible to read value(s) of specified property.
`boolean` | `isPropertyWritable(Object propertyKey)` Checks whether it is possible to write value(s) to specified property.
`Enumeration` | `properties()` Returns Enumeration of properties.
`Enumeration` | `properties(Object propertyKey)` Returns Enumeration of all values of given property.
`void` | `removePropertyMapListener(Object propertyKey, PropertyMapListener listener)` Removes listener of PropertyMapEvent for certain property.
`void` | `setPropertyValue(Object propertyKey, Object propertyValue)` Sets specified value for specified property.
`String` | `toString()` Returns a string containing the pairs key-value for all properties in this PropertyMap.

Method Detail

### addProperty

    public Property addProperty(Object propertyKey, Object propertyValue)

  Adds new property.
  Parameters:
    propertyKey - Name of new property
    propertyValue - Value of new property
  Returns: Added property

### addPropertyMapListener

    public void addPropertyMapListener(Object propertyKey, PropertyMapListener listener)

  Adds listener of PropertyMapEvent for certain property.
  Parameters:
    propertyKey - Key of property for which listener will be added
    l - Listener to be added

### addPropertyToEnd

    protected void addPropertyToEnd(DefaultProperty property)

  Adds specified property to the end of property list.
  Parameters:
    property - Property to be added

### canAddProperty

    public boolean canAddProperty(Object propertyKey, Object propertyValue)

  Checks whether it is possible to add specified property with specified value.
  Parameters:
    propertyKey - Name of property to be checked
    propertyValue - Value to be checked
  Returns: true if it is possible, false otherwise

### canSetPropertyValue

    public boolean canSetPropertyValue(Object propertyKey, Object propertyValue)

  Checks whether it is possible to set specified value for specified property.
  Parameters:
    propertyKey - Name of property to be checked
    propertyValue - Value to be checked
  Returns: true if it is possible, false otherwise

### createProperty

    protected DefaultProperty createProperty(Object key, Object value)

  Creates and returns a property with the specified key and value.
  Parameters:
    key - a key object
    value - a value which needs to be set for this property
  Returns: new just created property
  See Also:
    Property

### fireEvent

    protected void fireEvent(PropertyMapEvent event)

  Fires specified PropertyMapEvent.
  Parameters:
    event - PropertyMapEvent to be fired

### getPropertyValue

    public Object getPropertyValue(Object propertyKey)

  Return value of property with specified key.
  Parameters:
    propertyKey - Property name for which value will be returned

### getPropertyValue

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

  Return value of property with specified key and class of value.
  Parameters:
    propertyKey - Property name for which value will be returned
    valueClass - Class of value
  Returns: Value if property not null, otherwise returns null

### isPropertyReadable

    public boolean isPropertyReadable(Object propertyKey)

  Checks whether it is possible to read value(s) of specified property.
  Parameters:
    propertKey - Key of property to be checked
  Returns: true if it is possible, false otherwise

### isPropertyWritable

    public boolean isPropertyWritable(Object propertyKey)

  Checks whether it is possible to write value(s) to specified property.
  Parameters:
    propertKey - Key of property to be checked
  Returns: true if it is possible, false otherwise

### properties

    public Enumeration properties()

  Returns Enumeration of properties.
  Returns: Enumeration of properties

### properties

    public Enumeration properties(Object propertyKey)

  Returns Enumeration of all values of given property.
  Parameters:
    propertyKey - Key of property
  Returns: Enumeration of all values of given property

### removePropertyMapListener

    public void removePropertyMapListener(Object propertyKey, PropertyMapListener listener)

  Removes listener of PropertyMapEvent for certain property.
  Parameters:
    propertyKey - Key of property for which listener will be removed
    l - Listener to be added

### setPropertyValue

    public void setPropertyValue(Object propertyKey, Object propertyValue)

  Sets specified value for specified property.
  Parameters:
    propertyKey - Name of property to which new value will be set
    propertyValue - Value which will be set

### toString

    public String toString()

  Returns a string containing the pairs key-value for all properties in this PropertyMap.
  Returns: a string containing the pairs key-value for all properties in this PropertyMap

Association Links

to Class com.togethersoft.openapi.util.EventMulticaster

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