Interface AggregateClass
- All Superinterfaces:
DataClass
,PropertyHandler
- All Known Implementing Classes:
AggregateClassImpl
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
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
ConstantCLASS_NAME="Aggregate"
static final String
static final String
static final String
static final String
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
Modifier and TypeMethodDescriptionvoid
addAttribute
(String attributeName, DataClass type) Adds an attribute an the end of the attribute list.void
addAttributeProperty
(String attributeName, PropertyTreeNode newNode) addAttributeProperty.void
addAttributeProperty
(String attributeName, String propertyName, String propertyValue) Sets a new property value or overwrites an existing one for the given attribute with the valuepropertyValue
.boolean
containsAttribute
(String attributeName) Checks if the given attribute name is visible in this class.getAttributeInfos.An array of all visible attributes should be returned.getAttributeProperty
(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.getAttributeType
(String attributeName) Determine the type of the specified attribute.String[]
An array of all inherited attribute names.getInheritedAttributeType
(String attributeName) getInheritedAttributeType.String[]
An array of all local defined attribute names.getLocalAttributeType
(String attributeName) getLocalAttributeType.int
getNumberOfAttributes() == getAttributeNames().size();
int
getNumberOfLocalAttributes() == getLocalAttributeNames().size();
String[]
An array of all local defined attribute names that override an attribute definition from one of the super classes.boolean
hasAttribute
(String attributeName) Checks if the attribute name is defined in this class or in one of the super classesvoid
removeAttribute
(String attributeName) removes the given attributeremoveAttributeProperty
(String attributeName, String propertyName) A property for a given attribute can be removed by setting anull
property value or by using this method.void
updateAttributeType
(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, setPropertyRootNode
-
Field Details
-
CLASS_NAME
ConstantCLASS_NAME="Aggregate"
- See Also:
-
LOG_ATTRIBUTE_NAME_ALREADY_EXISTS
- See Also:
-
LOG_GET_PROPERTIES_ATT_FAILED
- See Also:
-
LOG_GET_PROPERTY_ATT_FAILED
- See Also:
-
LOG_SET_PROPERTY_ATT_FAILED
- See Also:
-
-
Method Details
-
addAttribute
void addAttribute(String attributeName, DataClass type) throws NameAlreadyExistsException, IllegalEditException Adds an attribute an the end of the attribute list.- Parameters:
attributeName
- aString
objecttype
- aDataClass
object- Throws:
NameAlreadyExistsException
IllegalEditException
- if any.
-
containsAttribute
Checks if the given attribute name is visible in this class.- Parameters:
attributeName
- aString
object- Returns:
- true if the given attribute name exists in this or in one of the parent AggregateClasses.
-
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
Determine the type of the specified attribute. Warning: Only works on finished classes, returnsnull
otherwise. To determine attribute-types in unfinished classes, callgetInheritedAttributeType
orgetLocalAttributeType
.- Parameters:
attributeName
- aString
object- 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
getInheritedAttributeType.
- Parameters:
attributeName
- aString
object- 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
getLocalAttributeType.
- Parameters:
attributeName
- aString
object- 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
Checks if the attribute name is defined in this class or in one of the super classes- Parameters:
attributeName
- aString
object- Returns:
- true if the given attribute name exists in this AggregateClass.
-
removeAttribute
removes the given attribute- Parameters:
attributeName
- aString
object- Throws:
IllegalEditException
- if any.
-
getAttributeProperty
String getAttributeProperty(String attributeName, String propertyName) throws ProCAKENoSuchAttributeException Gets the value of the given property name for the given attribute. If the property does not exists, null will be returned.- Parameters:
attributeName
- aString
objectpropertyName
- aString
object- Returns:
- The value of the property or null, if the property does not exists.
- Throws:
ProCAKENoSuchAttributeException
- if any.- See Also:
-
getAttributePropertyNames
To receive all properties of an attribute that are set use this method. The result will never be null.- Parameters:
attributeName
- aString
object- Returns:
- All properties of the specified attribute. null will be never returned.
- Throws:
ProCAKENoSuchAttributeException
- if any.- See Also:
-
removeAttributeProperty
String removeAttributeProperty(String attributeName, String propertyName) throws ProCAKENoSuchAttributeException A property for a given attribute can be removed by setting anull
property value or by using this method. In both cases the property is removed only if the property with the namepropertyName
exists.- Parameters:
propertyName
- The name of the property that should be removed.attributeName
- aString
object- Returns:
- The value of the removed property or
null
if the property does not exist. - Throws:
ProCAKENoSuchAttributeException
-
addAttributeProperty
void addAttributeProperty(String attributeName, String propertyName, String propertyValue) throws ProCAKENoSuchAttributeException Sets a new property value or overwrites an existing one for the given attribute with the valuepropertyValue
. IfpropertyName
isnull
nothing will happen. IfpropertyValue
isnull
, the property will be removed. This is the same like using the methodremoveAttributeProperty(String, String)
just without a return type.- Parameters:
attributeName
- aString
objectpropertyName
- aString
objectpropertyValue
- aString
object- Throws:
ProCAKENoSuchAttributeException
- if any.- See Also:
-
addAttributeProperty
addAttributeProperty.
- Parameters:
attributeName
- aString
objectnewNode
- aPropertyTreeNode
object
-
updateAttributeType
To change the type of the attribute call this message. If the attribute name does not exist, it will be automatically added.- Parameters:
attributeName
- aString
objectnewType
- aDataClass
object- Throws:
IllegalEditException
- if any.
-