Interface ElementInterface

    • Method Detail

      • getReference

        EntityReference getReference()
        Returns:
        the reference of the element
        Since:
        3.2M1
      • getDocumentReference

        DocumentReference getDocumentReference()
        Returns:
        the reference to the document in which this element is defined (for elements where this make sense, for example for an XClass or a XObject).
        Since:
        2.2M2
      • getName

        String getName()
        Returns:
        the free form name (for elements which don't point to a reference, for example for instances of BaseProperty).
      • setDocumentReference

        void setDocumentReference​(DocumentReference reference)
        Since:
        2.2M2
      • setName

        void setName​(String name)
      • merge

        void merge​(ElementInterface previousElement,
                   ElementInterface newElement,
                   MergeConfiguration configuration,
                   XWikiContext context,
                   MergeResult mergeResult)
        Apply a 3 ways merge on the current element based on provided previous and new version of the element.

        All 3 elements are supposed to have the same class and reference.

        Parameters:
        previousElement - the previous version of the element
        newElement - the next version of the element
        configuration - the configuration of the merge Indicate how to deal with some conflicts use cases, etc.
        context - the XWiki context
        mergeResult - the merge report
        Since:
        3.2M1
      • apply

        boolean apply​(ElementInterface newElement,
                      boolean clean)
        Apply the provided element so that the current one contains the same informations and indicate if it was necessary to modify it in any way.
        Parameters:
        newElement - the element to apply
        clean - true if informations that are not in the new element should be removed (for example class properties not in the new class)
        Returns:
        true if the element has been modified
        Since:
        4.3M1