Class ModelElementInstanceImpl

    • Field Detail

      • modelInstance

        protected final ModelInstanceImpl modelInstance
        the containing model instance
    • Method Detail

      • registerType

        public static void registerType​(ModelBuilder modelBuilder)
      • getAttributeValue

        public java.lang.String getAttributeValue​(java.lang.String attributeName)
        Description copied from interface: ModelElementInstance
        Returns the attribute value for the attribute name.
        Specified by:
        getAttributeValue in interface ModelElementInstance
        Parameters:
        attributeName - the name of the attribute
        Returns:
        the value of the attribute
      • getAttributeValueNs

        public java.lang.String getAttributeValueNs​(java.lang.String namespaceUri,
                                                    java.lang.String attributeName)
        Description copied from interface: ModelElementInstance
        Returns the attribute value for the given attribute name and namespace URI.
        Specified by:
        getAttributeValueNs in interface ModelElementInstance
        Parameters:
        namespaceUri - the namespace URI of the attribute
        attributeName - the attribute name of the attribute
        Returns:
        the value of the attribute
      • setAttributeValue

        public void setAttributeValue​(java.lang.String attributeName,
                                      java.lang.String xmlValue)
        Description copied from interface: ModelElementInstance
        Sets the value by name of a non-ID attribute.
        Specified by:
        setAttributeValue in interface ModelElementInstance
        Parameters:
        attributeName - the name of the attribute
        xmlValue - the value to set
      • setAttributeValue

        public void setAttributeValue​(java.lang.String attributeName,
                                      java.lang.String xmlValue,
                                      boolean isIdAttribute)
        Description copied from interface: ModelElementInstance
        Sets attribute value by name.
        Specified by:
        setAttributeValue in interface ModelElementInstance
        Parameters:
        attributeName - the name of the attribute
        xmlValue - the value to set
        isIdAttribute - true if the attribute is an ID attribute, false otherwise
      • setAttributeValue

        public void setAttributeValue​(java.lang.String attributeName,
                                      java.lang.String xmlValue,
                                      boolean isIdAttribute,
                                      boolean withReferenceUpdate)
        Description copied from interface: ModelElementInstance
        Sets attribute value by name.
        Specified by:
        setAttributeValue in interface ModelElementInstance
        Parameters:
        attributeName - the name of the attribute
        xmlValue - the value to set
        isIdAttribute - true if the attribute is an ID attribute, false otherwise
        withReferenceUpdate - true to update incoming references in other elements, false otherwise
      • setAttributeValueNs

        public void setAttributeValueNs​(java.lang.String namespaceUri,
                                        java.lang.String attributeName,
                                        java.lang.String xmlValue)
        Description copied from interface: ModelElementInstance
        Sets the value by name and namespace of a non-ID attribute.
        Specified by:
        setAttributeValueNs in interface ModelElementInstance
        Parameters:
        namespaceUri - the namespace URI of the attribute
        attributeName - the name of the attribute
        xmlValue - the XML value to set
      • setAttributeValueNs

        public void setAttributeValueNs​(java.lang.String namespaceUri,
                                        java.lang.String attributeName,
                                        java.lang.String xmlValue,
                                        boolean isIdAttribute)
        Description copied from interface: ModelElementInstance
        Sets the attribute value by name and namespace.
        Specified by:
        setAttributeValueNs in interface ModelElementInstance
        Parameters:
        namespaceUri - the namespace URI of the attribute
        attributeName - the name of the attribute
        xmlValue - the XML value to set
        isIdAttribute - true if the attribute is an ID attribute, false otherwise
      • setAttributeValueNs

        public void setAttributeValueNs​(java.lang.String namespaceUri,
                                        java.lang.String attributeName,
                                        java.lang.String xmlValue,
                                        boolean isIdAttribute,
                                        boolean withReferenceUpdate)
        Description copied from interface: ModelElementInstance
        Sets the attribute value by name and namespace.
        Specified by:
        setAttributeValueNs in interface ModelElementInstance
        Parameters:
        namespaceUri - the namespace URI of the attribute
        attributeName - the name of the attribute
        xmlValue - the XML value to set
        isIdAttribute - true if the attribute is an ID attribute, false otherwise
        withReferenceUpdate - true to update incoming references in other elements, false otherwise
      • removeAttribute

        public void removeAttribute​(java.lang.String attributeName)
        Description copied from interface: ModelElementInstance
        Removes attribute by name.
        Specified by:
        removeAttribute in interface ModelElementInstance
        Parameters:
        attributeName - the name of the attribute
      • removeAttributeNs

        public void removeAttributeNs​(java.lang.String namespaceUri,
                                      java.lang.String attributeName)
        Description copied from interface: ModelElementInstance
        Removes the attribute by name and namespace.
        Specified by:
        removeAttributeNs in interface ModelElementInstance
        Parameters:
        namespaceUri - the namespace URI of the attribute
        attributeName - the name of the attribute
      • getTextContent

        public java.lang.String getTextContent()
        Description copied from interface: ModelElementInstance
        Returns the text content of the DOM element without leading and trailing spaces. For raw text content see getRawTextContent().
        Specified by:
        getTextContent in interface ModelElementInstance
        Returns:
        text content of underlying DOM element with leading and trailing whitespace trimmed
      • setTextContent

        public void setTextContent​(java.lang.String textContent)
        Description copied from interface: ModelElementInstance
        Sets the text content of the DOM element
        Specified by:
        setTextContent in interface ModelElementInstance
        Parameters:
        textContent - the new text content
      • getRawTextContent

        public java.lang.String getRawTextContent()
        Description copied from interface: ModelElementInstance
        Returns the raw text content of the DOM element including all whitespaces.
        Specified by:
        getRawTextContent in interface ModelElementInstance
        Returns:
        raw text content of underlying DOM element
      • getUniqueChildElementByNameNs

        public ModelElementInstance getUniqueChildElementByNameNs​(java.lang.String namespaceUri,
                                                                  java.lang.String elementName)
        Description copied from interface: ModelElementInstance
        Returns a child element with the given name or 'null' if no such element exists
        Specified by:
        getUniqueChildElementByNameNs in interface ModelElementInstance
        Parameters:
        namespaceUri - the local name of the element
        elementName - the namespace of the element
        Returns:
        the child element or null.
      • addChildElement

        public void addChildElement​(ModelElementInstance newChild)
        Description copied from interface: ModelElementInstance
        Adds a new child element to the children of this element. The child is inserted at the correct position of the allowed child types. Updates the underlying DOM element tree.
        Specified by:
        addChildElement in interface ModelElementInstance
        Parameters:
        newChild - the new child element
      • getChildElementsByType

        public <T extends ModelElementInstance> java.util.Collection<T> getChildElementsByType​(java.lang.Class<T> childElementClass)
        Description copied from interface: ModelElementInstance
        Return all child elements of a given type
        Specified by:
        getChildElementsByType in interface ModelElementInstance
        Parameters:
        childElementClass - the class of the child element type to search for
        Returns:
        a collection of elements to the given type
      • insertElementAfter

        public void insertElementAfter​(ModelElementInstance elementToInsert,
                                       ModelElementInstance insertAfterElement)
        Description copied from interface: ModelElementInstance
        Inserts the new element after the given element or at the beginning if the given element is null.
        Specified by:
        insertElementAfter in interface ModelElementInstance
        Parameters:
        elementToInsert - the new element to insert
        insertAfterElement - the element to insert after or null to insert at first position
      • asSet

        protected <T> java.util.Set<T> asSet​(T element,
                                             java.util.Set<T> elements)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object