Class AbstractDataClassImpl

    • Constructor Detail

      • AbstractDataClassImpl

        protected AbstractDataClassImpl​(String name)

        Constructor for AbstractDataClassImpl.

        Parameters:
        name - a String object
    • Method Detail

      • beSystemClass

        protected void beSystemClass()

        beSystemClass.

      • checkFinishEditing

        protected void checkFinishEditing()
                                   throws ClassHierarchyConsistencyException
        This method only checks if it is possible to finish the class and does not change any internal status. To initialize internal caches use the method finishEditing().

        Sub classes are allowed to overwrite this method with own code but they must follow some instructions. It is very important to call the checkFinishEditing() method in the super class. This can be done before or after the own check methods. But it is advisable to implement the methods like in finishEditing() where first the super class is called. For example:

        protected void checkFinishEditing() throws ClassHierarchyConsistencyException { super.checkFinishEditing(); // put your code here }
        Throws:
        ClassHierarchyConsistencyException
        See Also:
        finishEditing()
      • addSubclass

        public void addSubclass​(DataClass subclass)
        Adds a givenn subclass to the subclassList.
        Specified by:
        addSubclass in interface DataClass
        Parameters:
        subclass - The subclass which gets added to the subclassList
      • removeSubclass

        public void removeSubclass​(DataClass subclass)
        Removes a subclass from the subclassList.
        Specified by:
        removeSubclass in interface DataClass
        Parameters:
        subclass - The subclass which gets removed from the subclassList
      • addSubClass

        public void addSubClass​(DataClass subclass)

        addSubClass.

        Parameters:
        subclass - a DataClass object
      • createSystemClassTree

        protected void createSystemClassTree​(DataClass superClass)

        createSystemClassTree.

        Parameters:
        superClass - a DataClass object
      • createSystemSubClasses

        protected abstract void createSystemSubClasses()

        createSystemSubClasses.

      • finishEditing

        public void finishEditing()
                           throws ClassHierarchyConsistencyException
        To instantiate classes it is necessary to know if the class can be edited further. Only finished classes can be instantiated. Therefore, it is necessary to call this method to tell the system that the class is ready defined. Nevertheless, finishing a class can fail because of an inconsistency in the class hierarchy. One of the superclasses is not consistence with this class. The finishing process is distinguished into two parts:
        1. it is checked if it is possible to finish the class
        2. the class is finished

        Therefore, the method finishEditing() first calls the method checkFinishEditing(). Sub classes can overwrite both methods but must follow the instructions describe now.

        Sub classes are allowed to overwrite this method to initialize the class, e.g., create internal caches. But the methods must first call the method finishEditing() in the super class. For example:

        public void finishEditing() throws ClassHierarchyConsistencyException { super.finishEditing(); // put your own finishing code here }
        Specified by:
        finishEditing in interface DataClass
        Throws:
        ClassHierarchyConsistencyException - if any.
        See Also:
        DataClass.finishEditing(), checkFinishEditing()
      • getModel

        public Model getModel()
        Each data class knows the Model to that the class belongs.
        Specified by:
        getModel in interface DataClass
        Returns:
        The Model of the data class.
      • getName

        public String getName()
        Each data class has a name that must be unique in the Model.
        Specified by:
        getName in interface DataClass
        Returns:
        the unique name of the data class
      • getSystemClassName

        public String getSystemClassName()
        Each data class belongs to a system class with a unique name.
        Specified by:
        getSystemClassName in interface DataClass
        Returns:
        the unique system class name
      • getPropertyNode

        public PropertyTreeNode getPropertyNode​(String key)
        Search for a property node within the whole tree of properties. The first node with a given name will be returned. The generic root node cannot be returned. The used search algorithm to iterate the property tree is BFS.
        Specified by:
        getPropertyNode in interface PropertyHandler
        Parameters:
        key - the name of the property to search for
        Returns:
        the found property node, or null, if there are no properties or no node has this key
      • getProperty

        public String getProperty​(String key)
        Gets the value of the node that has the given name and is found first. If the property does not exists, null will be returned.
        Specified by:
        getProperty in interface PropertyHandler
        Parameters:
        key - The name of the property.
        Returns:
        The property value or null if the property does not exists.
        See Also:
        PropertyHandler.getPropertyNode(String)
      • removeProperty

        public String removeProperty​(String name)
        Remove any node from the property tree. The first node to be found with this name, will be removed (including all children).
        Specified by:
        removeProperty in interface PropertyHandler
        Parameters:
        name - the name of the node to be removed
        Returns:
        the value of the removed node, or null, if no node could be removed
      • addProperty

        public void addProperty​(PropertyTreeNode node)
        Add a property to the property tree. This property node (or subtree) will be added right below the generic root.
        Specified by:
        addProperty in interface PropertyHandler
        Parameters:
        node - the node to be added
      • getAllPropertyNodes

        public List<PropertyTreeNode> getAllPropertyNodes​(String key)
        Searches for all property nodes within the property tree. The result will never be null (but could be an empty set).
        Specified by:
        getAllPropertyNodes in interface PropertyHandler
        Parameters:
        key - the key of the property
        Returns:
        a set with the found property nodes
      • getAllProperties

        public List<String> getAllProperties​(String key)
        Searches for all property values within the property tree. The result will never be null (but could be an empty set).
        Specified by:
        getAllProperties in interface PropertyHandler
        Parameters:
        key - the key of the property
        Returns:
        a set with the found property nodes
      • hasProperties

        public boolean hasProperties()
        Tests, if the implementing object has properties. This can be tested by looking for a generic root node.
        Specified by:
        hasProperties in interface PropertyHandler
        Returns:
        true, if a property is set, false otherwise.
      • getRootClass

        protected DataClass getRootClass()

        getRootClass.

        Returns:
        a DataClass object
      • getSubClasses

        public List<DataClass> getSubClasses()
        This methods returns an array of all direct sub classes of this class. This does not include system classes or sub sub classes and so on. Only the direct ones.
        Specified by:
        getSubClasses in interface DataClass
        Returns:
        An array of sub classes for this DataClasses or an empty array but never null.
      • getSuperClass

        public DataClass getSuperClass()
        Each data class has a super class from that the class is inherited. This class can be get with this method. If this method is used on the root data class null will be returned.
        Specified by:
        getSuperClass in interface DataClass
        Returns:
        The parent class or super class of this class or null if this class is the root class.
      • setSuperClass

        protected void setSuperClass​(AbstractDataClassImpl superClass)
        This is the last method in the instantiation procedure that can be used for some final initializations. Implementations should first call super.setSuperClass(DataClassImpl) before using own initializations.
        Parameters:
        superClass - The super class.
      • getSuperClasses

        public DataClass[] getSuperClasses()
        Sometimes it can be necessary to have the inheritance hierarchy of the class. This hierarchy can be accessed with this method.
        Specified by:
        getSuperClasses in interface DataClass
        Returns:
        All super classes in the class hierarchy including the system super classes.
      • getSystemSuperClass

        public DataClass getSystemSuperClass()
        Instead of receiving the super class of this class ( DataClass.getSuperClass()) this class returns the first super class in the class hierarchy that is a system class.
        Specified by:
        getSystemSuperClass in interface DataClass
        Returns:
        The first system super class in the class hierarchy.
      • includeClass

        public boolean includeClass​(DataClass anotherClass)
        This method checks if the data class contains a reference to another data class.

        Some data classes contain other data classes. For example, AggregateClasses contain as attribute type other data classes or CollectionClasses have one element type which is also a data class.

        To prevent an infinite loop, this method does not recursive navigates through all element classes. Only the element of the class are checked but not, if the elements include the given anotherClass.

        Specified by:
        includeClass in interface DataClass
        Parameters:
        anotherClass - The data class that has to be checked for references
        Returns:
        true if the data class contains a reference to the give anotherClass.
      • isAbstract

        public boolean isAbstract()

        isAbstract.

        Specified by:
        isAbstract in interface DataClass
        Returns:
        true if the class is abstract and can not be instantiated
      • setAbstract

        public void setAbstract​(boolean value)
                         throws IllegalEditException
        It is possible to model abstract user classes. The default is that a user class is not abstract. But in special cases it can be useful to change this behavior.
        Specified by:
        setAbstract in interface DataClass
        Parameters:
        value - true if the user class should be an abstract class.
        Throws:
        IllegalEditException - if any.
      • isAggregate

        public boolean isAggregate()

        isAggregate.

        Specified by:
        isAggregate in interface DataClass
        Returns:
        true if the data class can be casted to AggregateClass
      • isAtomic

        public boolean isAtomic()

        isAtomic.

        Specified by:
        isAtomic in interface DataClass
        Returns:
        true if the data class can be casted to AtomicClass
      • isBoolean

        public boolean isBoolean()

        isBoolean.

        Specified by:
        isBoolean in interface DataClass
        Returns:
        true if the data class can be casted to BooleanClass
      • isByteArray

        public boolean isByteArray()

        isByteArray.

        Specified by:
        isByteArray in interface DataClass
        Returns:
        true if the data class can be casted to ByteArrayClass
      • isDate

        public boolean isDate()

        isDate.

        Specified by:
        isDate in interface DataClass
        Returns:
        true if the data class can be casted to DateClass
      • isDouble

        public boolean isDouble()

        isDouble.

        Specified by:
        isDouble in interface DataClass
        Returns:
        true if the data class can be casted to DoubleClass
      • isEditable

        public boolean isEditable()

        isEditable.

        Specified by:
        isEditable in interface DataClass
        Returns:
        true if the class can be edited
      • isInstantiable

        public boolean isInstantiable()
        To instantiate a class it is not allowed that the class is editable or abstract. Some system classes are also not instantiable
        Specified by:
        isInstantiable in interface DataClass
        Returns:
        true if this class can be instantiated.
      • isInteger

        public boolean isInteger()

        isInteger.

        Specified by:
        isInteger in interface DataClass
        Returns:
        true if the data class can be casted to IntegerClass
      • isInterval

        public boolean isInterval()

        isInterval.

        Specified by:
        isInterval in interface DataClass
        Returns:
        true if the data class can be casted to IntervalClass
      • isList

        public boolean isList()

        isList.

        Specified by:
        isList in interface DataClass
        Returns:
        true if the data class can be casted to ListClass
      • isNumeric

        public boolean isNumeric()

        isNumeric.

        Specified by:
        isNumeric in interface DataClass
        Returns:
        true if the data class can be casted to NumericClass
      • isURI

        public boolean isURI()

        isURI.

        Specified by:
        isURI in interface DataClass
        Returns:
        true if the data class can be casted to URIClass
      • isSet

        public boolean isSet()

        isSet.

        Specified by:
        isSet in interface DataClass
        Returns:
        true if the data class can be casted to SetClass
      • isString

        public boolean isString()

        isString.

        Specified by:
        isString in interface DataClass
        Returns:
        true if the data class can be casted to StringClass
      • isAdaptationCase

        public boolean isAdaptationCase()

        isAdaptationCase.

        Returns:
        a boolean
      • isSequence

        public boolean isSequence()

        isSequence.

        Specified by:
        isSequence in interface DataClass
        Returns:
        true if the data class can be casted to SequenceClass
      • isWorkflow

        public boolean isWorkflow()

        isWorkflow.

        Specified by:
        isWorkflow in interface DataClass
        Returns:
        true if the data class can be casted to WorkflowClass
      • isTask

        public boolean isTask()

        isTask.

        Specified by:
        isTask in interface DataClass
        Returns:
        true if the data class can be casted to TaskClass
      • isNode

        public boolean isNode()

        isNode.

        Specified by:
        isNode in interface DataClass
        Returns:
        true if the data class can be casted to NodeClass
      • isNESTNode

        public boolean isNESTNode()

        isNESTNode.

        Specified by:
        isNESTNode in interface DataClass
        Returns:
        true if the data class can be casted to NESTNodeClass
      • isNESTEdge

        public boolean isNESTEdge()

        isNESTEdge.

        Specified by:
        isNESTEdge in interface DataClass
        Returns:
        true if the data class can be casted to NESTEdgeClass
      • isNESTGraph

        public boolean isNESTGraph()

        isNESTGraph.

        Specified by:
        isNESTGraph in interface DataClass
        Returns:
        true if the data class can be casted to NESTGraphClass
      • isNESTQuery

        public boolean isNESTQuery()

        isNESTQuery.

        Returns:
        a boolean
      • isNESTAdaptationQuery

        public boolean isNESTAdaptationQuery()

        isNESTAdaptationQuery.

        Returns:
        a boolean
      • isNESTAdaptationRule

        public boolean isNESTAdaptationRule()

        isNESTAdaptationRule.

        Returns:
        a boolean
      • isNESTAdaptationStep

        public boolean isNESTAdaptationStep()

        isNESTAdaptationStep.

        Returns:
        a boolean
      • isNESTAdaptationSession

        public boolean isNESTAdaptationSession()

        isNESTAdaptationSession.

        Returns:
        a boolean
      • isWorkflowCase

        public boolean isWorkflowCase()

        isWorkflowCase.

        Returns:
        a boolean
      • isSubclassOf

        public boolean isSubclassOf​(DataClass anotherClass)
        Checks if this class is inherited from anotherClass or from a sub class of anotherClass.
        Specified by:
        isSubclassOf in interface DataClass
        Parameters:
        anotherClass - a DataClass object
        Returns:
        true if this class is a subclass of anotherClass
      • isSystemClass

        public boolean isSystemClass()

        isSystemClass.

        Specified by:
        isSystemClass in interface DataClass
        Returns:
        true if this class is a system class.
      • isTime

        public boolean isTime()

        isTime.

        Specified by:
        isTime in interface DataClass
        Returns:
        true if the data class can be casted to TimeClass
      • isTimestamp

        public boolean isTimestamp()

        isTimestamp.

        Specified by:
        isTimestamp in interface DataClass
        Returns:
        true if the data class can be casted to TimestampClass
      • isUnion

        public boolean isUnion()

        isUnion.

        Specified by:
        isUnion in interface DataClass
        Returns:
        true if the data class can be casted to UnionClass
      • isVoid

        public boolean isVoid()

        isVoid.

        Specified by:
        isVoid in interface DataClass
        Returns:
        true if the data class can be casted to VoidClass
      • clearSubClasses

        protected void clearSubClasses()

        clearSubClasses.