com.togethersoft.openapi.model.elements
Interface PropertyMap

All Known Subinterfaces:
Element, Entity, Model, Reference, ReferenceCollection

public interface PropertyMap

This interface represents a map of object's properties. Term "map"
assumes some mapping and in this case it is mapping of the property name
to the property value(s). The responsibility of the object represented
by this interface is to provide convenient methods of mapping items
manipulation like property value setting and retrieving, adding new
properties, etc.



Basically all property values have String type. However we
separate so-called boolean properties. Property is boolean if
its particular values do not matter and the only thing we are interested
in is whether the value of this property is null or not. It is
a good idea to return empty string as a value of the boolean property. It is
clear that boolean property can not be multivalued



IMPORTANT IMPLEMENTATION ISSUE: implementation of the model interfaces
in Together core is not thread safe. Access to all methods of this
interface implementation should be performed in command thread

Author:
TogetherSoft
See Also: ExtensionManager

Method Summary
 PropertyaddProperty(String propertyName, String propertyValue)
          Creates and adds to this property map new property with the
given propertyName and propertyValue
 booleancanAddProperty(String propertyName, String propertyValue)
           
 booleancanSetPropertyValue(String propertyName, String propertyValue)
           
 booleancanSetPropertyValue(String propertyName, boolean propertyValue)
          This method is just a "shortcut" for boolean properties
 PropertygetProperty(String propertyName)
           
 StringgetPropertyValue(String propertyName)
           
 booleanhasProperty(String propertyName)
           
 booleanhasPropertyValue(String propertyName, String propertyValue)
           
 booleanisPropertyReadable(String propertyName)
           
 booleanisPropertyWritable(String propertyName)
           
 PropertyEnumerationproperties()
           
 PropertyEnumerationproperties(String propertyName)
           
 voidsetPropertyValue(String propertyName, String propertyValue)
          Sets the value of a property with the given propertyName
to propertyValue
 voidsetPropertyValue(String propertyName, boolean propertyValue)
          This method is just a "shortcut" for boolean properties
Sets the value of a property with the given propertyName
to propertyValue

Method Detail

addProperty

public Property addProperty(String propertyName, String propertyValue)
Creates and adds to this property map new property with the
given propertyName and propertyValue
Returns: Instance of the newly created property

canAddProperty

public boolean canAddProperty(String propertyName, String propertyValue)
Returns: true if it is possible to add new
property with the given propertyName and
propertyValue to this property map

canSetPropertyValue

public boolean canSetPropertyValue(String propertyName, String propertyValue)
Returns: true if given propertyValue is
valid for a property with the given propertyName.
Note that it is not the same as isWritable(). It is
possible that property is writable but some particular value
can not be set.

canSetPropertyValue

public boolean canSetPropertyValue(String propertyName, boolean propertyValue)
This method is just a "shortcut" for boolean properties
Returns: true if given propertyValue is valid
for a property with the given propertyName.

getProperty

public Property getProperty(String propertyName)
Returns: Property with the given propertyName
Return value is null if property with such name does not
exist. If the property exists and is multivalued then the property returned
should be one of the currently existing properties. However, it is impossible
to point out apriori the property which will be returned.

getPropertyValue

public String getPropertyValue(String propertyName)
Returns: A value of a property with the given propertyName
Return value is null if property with such name does not
exist. If the property exists and is multivalued then the value returned
should be one of the currently existing values. However, it is impossible
to point out apriori the value which will be returned.

hasProperty

public boolean hasProperty(String propertyName)
Returns: true if this property map contains property with
the given propertyName.

hasPropertyValue

public boolean hasPropertyValue(String propertyName, String propertyValue)
Returns: true if the set of current values of the property
with the given propertyName contains value
propertyValue

isPropertyReadable

public boolean isPropertyReadable(String propertyName)
Returns: true if a property with the given
propertyName is readable.

isPropertyWritable

public boolean isPropertyWritable(String propertyName)
Returns: true if a property with the given
propertyName is writable.

properties

public PropertyEnumeration properties()
Returns: Enumeration of all properties in this property map

properties

public PropertyEnumeration properties(String propertyName)
Returns: Enumeration of properties in this property map
with the given propertyName.

setPropertyValue

public void setPropertyValue(String propertyName, String propertyValue)
Sets the value of a property with the given propertyName
to propertyValue

setPropertyValue

public void setPropertyValue(String propertyName, boolean propertyValue)
This method is just a "shortcut" for boolean properties
Sets the value of a property with the given propertyName
to propertyValue

Association Links

to Class com.togethersoft.openapi.model.elements.Property

Supplier Cardinality 0..*
Type aggregationByValue