com.togethersoft.openapi.util.propertyMap
Class PropertyAdapter


public class PropertyAdapter
implements Property

Default implementation of the Property interace.
Provides a set of methods for accessing and changing property's value.

Author:
TogetherSoft
Since: Together 4.0

Field Summary
 private Objectkey
           
 private PropertyMapmyPropertyMap
           
 private Objectvalue
           

Constructor Summary
PropertyAdapter(Object key)
          Creates new property with null value.
PropertyAdapter(Object key, Object value)
          Creates new property.
PropertyAdapter(Object key, Object value, PropertyMap propertyMap)
          Creates new property with PropertyMap of subproperties.

Method Summary
 booleancanSetValue(Object value)
          Checks whether it is possible to set the specified value to the property.
 ObjectgetKey()
          Returns a key for this property.
 PropertyMapgetSubproperties()
          Returns PropertyMap of subproperties.
 ObjectgetValue()
          Returns a value of this property.
 ObjectgetValue(Class valueClass)
          Returns a value of this property as a specified class instance.
 booleanisReadable()
          Checks whether this property is readable.
 booleanisWritable()
          Checks whether this property is writable.
 voidsetValue(Object value)
          Set the value for this property.

Field Detail

key

private Object key

myPropertyMap

private PropertyMap myPropertyMap

value

private Object value
Constructor Detail

PropertyAdapter

public PropertyAdapter(Object key)
Creates new property with null value.
Parameters:
key Key (name) of property

PropertyAdapter

public PropertyAdapter(Object key, Object value)
Creates new property.
Parameters:
key Key (name) of property
value Value of property

PropertyAdapter

public PropertyAdapter(Object key, Object value, PropertyMap propertyMap)
Creates new property with PropertyMap of subproperties.
Parameters:
key Key (name) of property
value Value of property
propertyMap PropertyMap of subproperties
Method Detail

canSetValue

public boolean canSetValue(Object value)
Checks whether it is possible to set the specified value to the property.
Parameters:
value the value which needs to be assigned to this property.
Returns: true if the specified value can be assigned to this property, false
otherwise

getKey

public Object getKey()
Returns a key for this property.
Returns: a key for this property

getSubproperties

public PropertyMap getSubproperties()
Returns PropertyMap of subproperties.
Returns: Always null.

getValue

public Object getValue()
Returns a value of this property.
Returns: a value of this property

getValue

public Object getValue(Class valueClass)
throws CastNotSupportedException
Returns a value of this property as a specified class instance.
Parameters:
valueClass a class (superclass) of a value of this property
Returns: a value of this property
Throws:
CastNotSupportedException If class of a value of this property is not a subclass or the same
class that the specified class

isReadable

public boolean isReadable()
Checks whether this property is readable.
Returns: true if this property is readable, false otherwise

isWritable

public boolean isWritable()
Checks whether this property is writable.
Returns: true if this property is writable, false otherwise

setValue

public void setValue(Object value)
Set the value for this property.
Parameters:
value the value which needs to be assigned to this property

Association Links

to Class java.lang.Object

to Class java.lang.Object

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