Class ReferenceImpl<T extends ModelElementInstance>

    • Field Detail

      • referenceTargetAttribute

        protected AttributeImpl<java.lang.String> referenceTargetAttribute
    • Constructor Detail

      • ReferenceImpl

        public ReferenceImpl()
    • Method Detail

      • setReferenceIdentifier

        protected abstract void setReferenceIdentifier​(ModelElementInstance referenceSourceElement,
                                                       java.lang.String referenceIdentifier)
        Set the reference identifier in the reference source
        Parameters:
        referenceSourceElement - the reference source model element instance
        referenceIdentifier - the new reference identifier
      • getReferenceTargetElement

        public T getReferenceTargetElement​(ModelElementInstance referenceSourceElement)
        Get the reference target model element instance
        Specified by:
        getReferenceTargetElement in interface Reference<T extends ModelElementInstance>
        Parameters:
        referenceSourceElement - the reference source model element instance
        Returns:
        the reference target model element instance or null if not set
      • setReferenceTargetElement

        public void setReferenceTargetElement​(ModelElementInstance referenceSourceElement,
                                              T referenceTargetElement)
        Set the reference target model element instance
        Specified by:
        setReferenceTargetElement in interface Reference<T extends ModelElementInstance>
        Parameters:
        referenceSourceElement - the reference source model element instance
        referenceTargetElement - the reference target model element instance
        Throws:
        ModelReferenceException - if element is not already added to the model
      • setReferenceTargetAttribute

        public void setReferenceTargetAttribute​(AttributeImpl<java.lang.String> referenceTargetAttribute)
        Set the reference target attribute
        Parameters:
        referenceTargetAttribute - the reference target string attribute
      • setReferenceTargetElementType

        public void setReferenceTargetElementType​(ModelElementTypeImpl referenceTargetElementType)
        Set the reference target model element type
        Parameters:
        referenceTargetElementType - the referenceTargetElementType to set
      • findReferenceSourceElements

        public java.util.Collection<ModelElementInstance> findReferenceSourceElements​(ModelElementInstance referenceTargetElement)
        Description copied from interface: Reference
        Find all reference source element instances of the reference target model element instance
        Specified by:
        findReferenceSourceElements in interface Reference<T extends ModelElementInstance>
        Parameters:
        referenceTargetElement - the reference target model element instance
        Returns:
        the collection of all reference source element instances
      • updateReference

        protected abstract void updateReference​(ModelElementInstance referenceSourceElement,
                                                java.lang.String oldIdentifier,
                                                java.lang.String newIdentifier)
        Update the reference identifier of the reference source model element instance
        Parameters:
        referenceSourceElement - the reference source model element instance
        oldIdentifier - the old reference identifier
        newIdentifier - the new reference identifier
      • referencedElementUpdated

        public void referencedElementUpdated​(ModelElementInstance referenceTargetElement,
                                             java.lang.String oldIdentifier,
                                             java.lang.String newIdentifier)
        Update the reference identifier
        Parameters:
        referenceTargetElement - the reference target model element instance
        oldIdentifier - the old reference identifier
        newIdentifier - the new reference identifier
      • removeReference

        protected abstract void removeReference​(ModelElementInstance referenceSourceElement,
                                                ModelElementInstance referenceTargetElement)
        Remove the reference in the reference source model element instance
        Parameters:
        referenceSourceElement - the reference source model element instance
      • referencedElementRemoved

        public void referencedElementRemoved​(ModelElementInstance referenceTargetElement,
                                             java.lang.Object referenceIdentifier)
        Remove the reference if the target element is removed
        Parameters:
        referenceTargetElement - the reference target model element instance, which is removed
        referenceIdentifier - the identifier of the reference to filter reference source elements