pl.edu.agh.cast.data.model.property
Interface IPropertyContainer

All Superinterfaces:
IValidatable, Observer, Serializable
All Known Subinterfaces:
IDataSet<T>, IDomainDataSet<T>, IDomainElement, IElement, IEntity, IGeneralDataSet<T>, IGeneralElement, IManyToManyRelation, IOneToOneRelation, IPresentationDataSet<T>, IPresentationElement<T>, ISchemaConnection, ISchemaDataSet, ISchemaElement<T>, ISchemaNode, ITimedManyToManyRelation, ITimedOneToOneRelation, IVisualDataSet<T,M>, IVisualElement<M>, IVisualSchemaConnection, IVisualSchemaDataSet, IVisualSchemaElement<T>, IVisualSchemaNode
All Known Implementing Classes:
AbstractDataSet, AbstractElement, DomainDataSet, Entity, GeneralDataSet, ManyToManyRelation, OneToOneRelation, PresentationDataSet, PresentationElement, PropertyContainer, SampleGeneralDataSet, SchemaConnection, SchemaDataSet, SchemaNode, TimedManyToManyRelation, TimedOneToOneRelation, VisualDataSet, VisualElement, VisualSchemaConnection, VisualSchemaDataSet, VisualSchemaNode

public interface IPropertyContainer
extends Observer, IValidatable, Serializable

Interface of Property container.

Author:
AGH CAST Team

Method Summary
 void addProperty(Property<? extends MetaProperty> property)
          Adds property to this container.
 Collection<CustomProperty> getCustomProperties()
          Returns all custom properties.
 MetaPropertyManager getMetaPropertyManager()
          Returns MetaPropertyManager of this container's properties.
 Collection<PermanentProperty> getPermanentProperties()
          Returns all permanent properties.
 Collection<Property<? extends MetaProperty>> getProperties()
          Returns all properties.
 Property<? extends MetaProperty> getProperty(String name)
          Returns property with given name.
 Collection<TransientProperty> getTransientProperties()
          Returns all transient properties.
 boolean matches(IPropertyContainer other)
          Checks if this property container matches the property container argument.
 Property<? extends MetaProperty> removeProperty(String name)
          Removes property with given name.
 Property<? extends MetaProperty> setProperty(String name, Object value)
          Modifies property value.
 
Methods inherited from interface java.util.Observer
update
 
Methods inherited from interface pl.edu.agh.cast.common.IValidatable
isValid
 

Method Detail

getProperties

Collection<Property<? extends MetaProperty>> getProperties()
Returns all properties.

Returns:
unmodifiable collection of all properties

getCustomProperties

Collection<CustomProperty> getCustomProperties()
Returns all custom properties.

Returns:
unmodifiable collection of custom properties

getPermanentProperties

Collection<PermanentProperty> getPermanentProperties()
Returns all permanent properties.

Returns:
unmodifiable collection of permanent properties

getTransientProperties

Collection<TransientProperty> getTransientProperties()
Returns all transient properties.

Returns:
unmodifiable collection of transient properties

addProperty

void addProperty(Property<? extends MetaProperty> property)
Adds property to this container.

Parameters:
property - property to add
Throws:
IllegalArgumentException - if property is null
PropertyException - if property with this name is already registered or if property's MetaProperty is not registered in the MetaPropertyManager (getMetaPropertyManager())

getProperty

Property<? extends MetaProperty> getProperty(String name)
Returns property with given name.

If a property was not yet created but a meta-property with given name is defined in meta-property manager then a new instance is added to the container and returned.

Parameters:
name - name of the property
Returns:
property with give name, or null if property with given name is not defined
Throws:
IllegalArgumentException - if given property name is not correctly formatted (see MetaProperty for details on property name formatting)

setProperty

Property<? extends MetaProperty> setProperty(String name,
                                             Object value)
Modifies property value.

Parameters:
name - name of the property
value - new value of the property
Returns:
modified property
Throws:
IllegalArgumentException - if given property name is not correctly formatted (see MetaProperty for details on property name formatting)
PropertyException - if property with given name is not registered or if this property cannot be modified (check MetaProperty.isWritable()) or if the value type is invalid for this property

removeProperty

Property<? extends MetaProperty> removeProperty(String name)
Removes property with given name.

Parameters:
name - name of the property
Returns:
the removed property
Throws:
IllegalArgumentException - if given property name is not correctly formatted (see MetaProperty for details on property name formatting)

getMetaPropertyManager

MetaPropertyManager getMetaPropertyManager()
Returns MetaPropertyManager of this container's properties.

Returns:
the meta property manager

matches

boolean matches(IPropertyContainer other)
Checks if this property container matches the property container argument. This method should be used to compare domain semantic of two objects, as it compares values of chosen (set as matchable) properties.

One container matches the second one if:

Parameters:
other - the reference property container with which to compare
Returns:
true if this container is matchable to the container argument.


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.