Interface AggregateClass
-
- All Superinterfaces:
DataClass,PropertyHandler
- All Known Implementing Classes:
AggregateClassImpl
public interface AggregateClass extends DataClass
The Aggregate Class uses the object oriented technique aggregation to combine several data classes into one class. This combination is realised with attributes that consist of a name and a corresponding data class, similar to instance variables of classes in object oriented programming languages. Arbitrary data classes can be used for the combination, especially other Aggregate Classes are possible. Thus, the modelling of deep aggregation hierarchies is possible.To create an aggregate class, it's necessary to edit the xml file model.xml with the super class "Aggregate" and an arbitrary name. The attributes can be defined in the inner tag. They also need a super class and a name.
For example, a aggregate class can look like:
<AggregateClass name="DataflowElement" superClass="Aggregate"> <Attribute name="name" class="String" /> </AggregateClass>- Author:
- rmaximi
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAggregateClass.AttributeInfo
-
Field Summary
Fields Modifier and Type Field Description static StringCLASS_NAMEConstantCLASS_NAME="Aggregate"static StringCOMPONENTComponent: "cake.data.model" (LogComponentIdentifier.COMPONENT)static StringCOMPONENT_KEYComponent-Key: "02" (LogComponentIdentifier.COMPONENT_KEY_AGGREGATECLASS)static StringLOG_ATTRIBUTE_NAME_ALREADY_EXISTSThe attribute-name already exists.static StringLOG_GET_PROPERTIES_ATT_FAILEDCould not get properties - attribute not found.static StringLOG_GET_PROPERTY_ATT_FAILEDCould not get property - attribute not found.static StringLOG_SET_PROPERTY_ATT_FAILEDCould not set property - attribute not found.-
Fields inherited from interface de.uni_trier.wi2.procake.data.model.DataClass
LOG_ABSTRACT_CLASS_NOT_INSTANTIABLE, LOG_ABSTRACT_SYSTEM_SUBCLASS_CREATION_FAILED, LOG_CLASS_NOT_EDITABLE, LOG_CLASS_NOT_INSTANTIABLE, LOG_EDITABLE_CLASS_NOT_INSTANTIABLE, LOG_FINISH_EDIT_FAILED, LOG_GET_SUPERCLASSES_FAILED, LOG_SUBCLASS_CREATION_FAILED
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAttribute(String attributeName, DataClass type)Adds an attribute an the end of the attribute list.voidaddAttributeProperty(String attributeName, PropertyTreeNode newNode)addAttributeProperty.voidaddAttributeProperty(String attributeName, String propertyName, String propertyValue)Sets a new property value or overwrites an existing one for the given attribute with the valuepropertyValue.booleancontainsAttribute(String attributeName)Checks if the given attribute name is visible in this class.List<AggregateClass.AttributeInfo>getAttributeInfos()getAttributeInfos.List<String>getAttributeNames()An array of all visible attributes should be returned.StringgetAttributeProperty(String attributeName, String propertyName)Gets the value of the given property name for the given attribute.String[]getAttributePropertyNames(String attributeName)To receive all properties of an attribute that are set use this method.DataClassgetAttributeType(String attributeName)Determine the type of the specified attribute.String[]getInheritedAttributeNames()An array of all inherited attribute names.DataClassgetInheritedAttributeType(String attributeName)getInheritedAttributeType.String[]getLocalAttributeNames()An array of all local defined attribute names.DataClassgetLocalAttributeType(String attributeName)getLocalAttributeType.intgetNumberOfAttributes()getNumberOfAttributes() == getAttributeNames().size();intgetNumberOfLocalAttributes()getNumberOfLocalAttributes() == getLocalAttributeNames().size();String[]getOverridenAttributeNames()An array of all local defined attribute names that override an attribute definition from one of the super classes.booleanhasAttribute(String attributeName)Checks if the attribute name is defined in this class or in one of the super classesvoidremoveAttribute(String attributeName)removes the given attributeStringremoveAttributeProperty(String attributeName, String propertyName)A property for a given attribute can be removed by setting anullproperty value or by using this method.voidupdateAttributeType(String attributeName, DataClass newType)To change the type of the attribute call this message.-
Methods inherited from interface de.uni_trier.wi2.procake.data.model.DataClass
addSubclass, checkInstantiability, createSubclass, finishEditing, getModel, getName, getObjectClass, getSubClasses, getSuperClass, getSuperClasses, getSystemClassName, getSystemSuperClass, includeClass, isAbstract, isAggregate, isAtomic, isBoolean, isByteArray, isCake2DataReference, isChronologic, isCollection, isControlflowItem, isDataflowWrapper, isDate, isDouble, isEditable, isInstantiable, isInteger, isInterval, isList, isNESTConstraintEdge, isNESTControlflowEdge, isNESTControlflowNode, isNESTDataflowEdge, isNESTDataNode, isNESTEdge, isNESTGraph, isNESTGraphItem, isNESTNode, isNESTPartOfEdge, isNESTSequenceNode, isNESTSequentialWorkflow, isNESTSubWorkflowNode, isNESTTaskNode, isNESTWorkflow, isNESTWorkflowNode, isNode, isNumeric, isParentItem, isSequence, isSet, isString, isSubclassOf, isSubWorkflow, isSystemClass, isTask, isTime, isTimestamp, isUnion, isURI, isVoid, isWorkflow, isWorkflowItem, newObject, removeSubclass, setAbstract, setName
-
Methods inherited from interface de.uni_trier.wi2.procake.data.PropertyHandler
addProperty, addProperty, getAllProperties, getAllPropertyNodes, getProperty, getPropertyNames, getPropertyNode, getPropertyRootNode, hasProperties, removeProperty
-
-
-
-
Field Detail
-
CLASS_NAME
static final String CLASS_NAME
ConstantCLASS_NAME="Aggregate"- See Also:
- Constant Field Values
-
COMPONENT
static final String COMPONENT
Component: "cake.data.model" (LogComponentIdentifier.COMPONENT)- See Also:
- Constant Field Values
-
COMPONENT_KEY
static final String COMPONENT_KEY
Component-Key: "02" (LogComponentIdentifier.COMPONENT_KEY_AGGREGATECLASS)- See Also:
- Constant Field Values
-
LOG_ATTRIBUTE_NAME_ALREADY_EXISTS
static final String LOG_ATTRIBUTE_NAME_ALREADY_EXISTS
The attribute-name already exists.- Component:
COMPONENT - Key: "0201"
- this
- See Also:
- Constant Field Values
- Component:
-
LOG_GET_PROPERTIES_ATT_FAILED
static final String LOG_GET_PROPERTIES_ATT_FAILED
Could not get properties - attribute not found.- Component:
COMPONENT - Key: "0204"
- this
- Attribute
- See Also:
- Constant Field Values
- Component:
-
LOG_GET_PROPERTY_ATT_FAILED
static final String LOG_GET_PROPERTY_ATT_FAILED
Could not get property - attribute not found.- Component:
COMPONENT - Key: "0203"
- this
- Attribute
- Property
- See Also:
- Constant Field Values
- Component:
-
LOG_SET_PROPERTY_ATT_FAILED
static final String LOG_SET_PROPERTY_ATT_FAILED
Could not set property - attribute not found.- Component:
COMPONENT - Key: "0202"
- this
- Attribute
- Property
- See Also:
- Constant Field Values
- Component:
-
-
Method Detail
-
addAttribute
void addAttribute(String attributeName, DataClass type) throws NameAlreadyExistsException, IllegalEditException
Adds an attribute an the end of the attribute list.- Parameters:
attributeName- aStringobjecttype- aDataClassobject- Throws:
NameAlreadyExistsExceptionIllegalEditException- if any.
-
containsAttribute
boolean containsAttribute(String attributeName)
Checks if the given attribute name is visible in this class.- Parameters:
attributeName- aStringobject- Returns:
- true if the given attribute name exists in this or in one of the parent AggregateClasses.
-
getAttributeNames
List<String> getAttributeNames()
An array of all visible attributes should be returned. That includes all local defined attributes and all attributes from all super classes. Overriden attributes are only returned once.The order in the array is not fixed and can vary in each message call.
Please note that the usage of this method does not work if the aggregate class is not finished.
- Returns:
- An array of attribute names. The result is never be null.
-
getAttributeInfos
List<AggregateClass.AttributeInfo> getAttributeInfos()
getAttributeInfos.
- Returns:
- A list of attribute informations.
-
getAttributeType
DataClass getAttributeType(String attributeName)
Determine the type of the specified attribute. Warning: Only works on finished classes, returnsnullotherwise. To determine attribute-types in unfinished classes, callgetInheritedAttributeTypeorgetLocalAttributeType.- Parameters:
attributeName- aStringobject- Returns:
- the type of the given attribute or null, if the attribute not exist
-
getInheritedAttributeNames
String[] getInheritedAttributeNames()
An array of all inherited attribute names.The order in the array is not fixed and can vary in each message call.
- Returns:
- An array of inherited attribute names. The result is never be null.
-
getInheritedAttributeType
DataClass getInheritedAttributeType(String attributeName)
getInheritedAttributeType.
- Parameters:
attributeName- aStringobject- Returns:
- the type of the given attribute or null, if the attribute not exist in one of the parents
-
getLocalAttributeNames
String[] getLocalAttributeNames()
An array of all local defined attribute names.The order in the array is not fixed and can vary in each message call.
- Returns:
- An array of local attribute names. The result is never be null.
-
getLocalAttributeType
DataClass getLocalAttributeType(String attributeName)
getLocalAttributeType.
- Parameters:
attributeName- aStringobject- Returns:
- the type of the given attribute or null, if the attribute not exist
-
getNumberOfAttributes
int getNumberOfAttributes()
getNumberOfAttributes() == getAttributeNames().size();- Returns:
- the number of visible attributes.
-
getNumberOfLocalAttributes
int getNumberOfLocalAttributes()
getNumberOfLocalAttributes() == getLocalAttributeNames().size();- Returns:
- the number of visible attributes.
-
getOverridenAttributeNames
String[] getOverridenAttributeNames()
An array of all local defined attribute names that override an attribute definition from one of the super classes.The order in the array is not fixed and can vary in each message call.
- Returns:
- An array of overriden attribute names. The result is never be null.
-
hasAttribute
boolean hasAttribute(String attributeName)
Checks if the attribute name is defined in this class or in one of the super classes- Parameters:
attributeName- aStringobject- Returns:
- true if the given attribute name exists in this AggregateClass.
-
removeAttribute
void removeAttribute(String attributeName) throws IllegalEditException
removes the given attribute- Parameters:
attributeName- aStringobject- Throws:
IllegalEditException- if any.
-
getAttributeProperty
String getAttributeProperty(String attributeName, String propertyName) throws NoSuchAttributeException
Gets the value of the given property name for the given attribute. If the property does not exists, null will be returned.- Parameters:
attributeName- aStringobjectpropertyName- aStringobject- Returns:
- The value of the property or null, if the property does not exists.
- Throws:
NoSuchAttributeException- if any.- See Also:
will be thrown.
-
getAttributePropertyNames
String[] getAttributePropertyNames(String attributeName) throws NoSuchAttributeException
To receive all properties of an attribute that are set use this method. The result will never be null.- Parameters:
attributeName- aStringobject- Returns:
- All properties of the specified attribute. null will be never returned.
- Throws:
NoSuchAttributeException- if any.- See Also:
will be thrown.
-
removeAttributeProperty
String removeAttributeProperty(String attributeName, String propertyName) throws NoSuchAttributeException
A property for a given attribute can be removed by setting anullproperty value or by using this method. In both cases the property is removed only if the property with the namepropertyNameexists.- Parameters:
propertyName- The name of the property that should be removed.attributeName- aStringobject- Returns:
- The value of the removed property or
nullif the property does not exist. - Throws:
NoSuchAttributeException
-
addAttributeProperty
void addAttributeProperty(String attributeName, String propertyName, String propertyValue) throws NoSuchAttributeException
Sets a new property value or overwrites an existing one for the given attribute with the valuepropertyValue. IfpropertyNameisnullnothing will happen. IfpropertyValueisnull, the property will be removed. This is the same like using the methodremoveAttributeProperty(String, String)just without a return type.- Parameters:
attributeName- aStringobjectpropertyName- aStringobjectpropertyValue- aStringobject- Throws:
NoSuchAttributeException- if any.- See Also:
will be thrown.
-
addAttributeProperty
void addAttributeProperty(String attributeName, PropertyTreeNode newNode)
addAttributeProperty.
- Parameters:
attributeName- aStringobjectnewNode- aPropertyTreeNodeobject
-
updateAttributeType
void updateAttributeType(String attributeName, DataClass newType) throws IllegalEditException
To change the type of the attribute call this message. If the attribute name does not exist, it will be automatically added.- Parameters:
attributeName- aStringobjectnewType- aDataClassobject- Throws:
IllegalEditException- if any.
-
-