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 SwitchablePropertyMap

public class SwitchablePropertyMap
implements PropertyMap

Represents PropertyMap with ability to switch to another PropertyMap.

Author:
  TogetherSoft

Constructor Summary
`SwitchablePropertyMap(PropertyMap map)` Creates new SwitchablePropertyMap from existing.
`SwitchablePropertyMap()` Creates new empty SwitchablePropertyMap.

Method Summary
`Property` | `addProperty(Object propertyKey, Object propertyValue)` Adds specified property with it's value.
`void` | `addPropertyMapListener(Object propertyKey, PropertyMapListener listener)` Adds listener of PropertyMapEvent for specified property.
`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 to specified property.
`protected void` | `fireEvent(PropertyMapEvent event)` Fires specified PropertyMapEvent.
`PropertyMap` | `getPropertyMap()` Returns current PropertyMap.
`Object` | `getPropertyValue(Object propertyKey)` Returns value of specified property.
`Object` | `getPropertyValue(Object propertyKey, Class valueClass)` Returns value of specified property and with specified class of value.
`boolean` | `isPropertyReadable(Object propertyKey)` Checks whether specified property can be read.
`boolean` | `isPropertyWritable(Object propertyKey)` Checks whether it is possible to write to specified property.
`Enumeration` | `properties()` Returns Enumeration of all properties.
`Enumeration` | `properties(Object propertyKey)` Returns values of specified property.
`void` | `removePropertyMapListener(Object propertyKey, PropertyMapListener listener)` Removes listener of PropertyMapEvent for specified property.
`void` | `setPropertyMap(PropertyMap map)` Specifies new PropertyMap.
`void` | `setPropertyValue(Object propertyKey, Object propertyValue)` Sets specified valuy to specified property.

Constructor Detail

### SwitchablePropertyMap

    public SwitchablePropertyMap(PropertyMap map)

  Creates new SwitchablePropertyMap from existing.
  Parameters:
    map - Source map

### SwitchablePropertyMap

    public SwitchablePropertyMap()

  Creates new empty SwitchablePropertyMap.

Method Detail

### addProperty

    public Property addProperty(Object propertyKey, Object propertyValue)

  Adds specified property with it's value.
  Parameters:
    propertyKey - Key of property to be added
    propertyValue - Value of new property
  Returns: Added Property

### addPropertyMapListener

    public void addPropertyMapListener(Object propertyKey, PropertyMapListener listener)

  Adds listener of PropertyMapEvent for specified property.
  Parameters:
    propertyKey - Key of property to which listener will be added
    listener - PropertyMapListener 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 - Key of property to be checked
    propertyValue - Value to be checked
  Returns: true if so, false otherwise

### canSetPropertyValue

    public boolean canSetPropertyValue(Object propertyKey, Object propertyValue)

  Checks whether it is possible to set specified value to specified property.
  Parameters:
    propertyKey - Key of property to be checked
    propertyValue - Value to be checked

### fireEvent

    protected void fireEvent(PropertyMapEvent event)

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

### getPropertyMap

    public PropertyMap getPropertyMap()

  Returns current PropertyMap.
  Returns: current PropertyMap

### getPropertyValue

    public Object getPropertyValue(Object propertyKey)

  Returns value of specified property.
  Parameters:
    propertyKey - Key of property for which value will be returned
  Returns: Value of specified property

### getPropertyValue

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

  Returns value of specified property and with specified class of value.
  Parameters:
    propertyKey - Key of property for which value will be returned
  Returns: Value of specified property

### isPropertyReadable

    public boolean isPropertyReadable(Object propertyKey)

  Checks whether specified property can be read.
  Parameters:
    propertyKey - Key of property to be checked
  Returns: true if so, false otherwise

### isPropertyWritable

    public boolean isPropertyWritable(Object propertyKey)

  Checks whether it is possible to write to specified property.
  Parameters:
    propertyKey - Key of property to be checked
  Returns: true if so, false otherwise

### properties

    public Enumeration properties()

  Returns Enumeration of all properties.
  Returns: Enumeration of all properties or EmptyEnumeration if there are no ones
  See Also:
    EmptyEnumeration

### properties

    public Enumeration properties(Object propertyKey)

  Returns values of specified property.
  Parameters:
    propertyKey - Key of property
  Returns: Values of specified property, or EmptyEnumeration if there are no ones
  See Also:
    EmptyEnumeration

### removePropertyMapListener

    public void removePropertyMapListener(Object propertyKey, PropertyMapListener listener)

  Removes listener of PropertyMapEvent for specified property.
  Parameters:
    propertyKey - Key of property to which listener will be removeded
    listener - PropertyMapListener to be removed

### setPropertyMap

    public void setPropertyMap(PropertyMap map)

  Specifies new PropertyMap.
  Parameters:
    map - New property map

### setPropertyValue

    public void setPropertyValue(Object propertyKey, Object propertyValue)

  Sets specified valuy to specified property.
  Parameters:
    propertyKey - Key of property fo which new value will be set / @param propertyValue New property value

Association Links

to Class com.togethersoft.openapi.util.propertyMap.PropertyMap

to Class com.togethersoft.openapi.util.propertyMap.PropertyMapListener

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