com.togethersoft.openapi.util.propertyMap
Interface Property

All Known Implementing Classes:
DefaultPropertyMap.DefaultProperty, PropertyAdapter

public interface Property

Represents a property - a key-value pair. This interface provides a set of methods for accessing and changing property's value.

Author:
TogetherSoft

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()
           Retruns all subproperties as a PropertyMap.
 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.

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()
Retruns all subproperties as a PropertyMap.
Returns: all subproperties as a PropertyMap

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