Class BaseProperty<R extends EntityReference>

    • Constructor Detail

      • BaseProperty

        public BaseProperty()
    • Method Detail

      • getClassType

        public String getClassType()
      • setClassType

        public void setClassType​(String type)
      • cloneInternal

        protected void cloneInternal​(BaseProperty clone)
        Subclasses override this to copy values during cloning.
        Parameters:
        clone - The cloned value.
      • getValue

        public Object getValue()
      • setValue

        public void setValue​(Object value)
      • toText

        public String toText()
      • toXMLString

        public String toXMLString()
        Return a XML version of this collection.

        The XML is not formated. to get formatted XML you can use BaseElement.toXMLString(boolean) instead.

        Returns:
        the XML as a String
      • getCustomMappingValue

        public Object getCustomMappingValue()
      • merge

        public void merge​(ElementInterface previousElement,
                          ElementInterface newElement,
                          MergeConfiguration configuration,
                          XWikiContext context,
                          MergeResult mergeResult)
        Description copied from interface: ElementInterface
        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.

        Specified by:
        merge in interface ElementInterface
        Overrides:
        merge in class BaseElement<R extends EntityReference>
        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
      • mergeValue

        protected void mergeValue​(Object previousValue,
                                  Object newValue,
                                  MergeResult mergeResult)
        Try to apply 3 ways merge on property value.
        Parameters:
        previousValue - the previous version of the value
        newValue - the new version of the value
        mergeResult - merge report
        Since:
        3.2M1
      • apply

        public boolean apply​(ElementInterface newProperty,
                             boolean clean)
        Description copied from interface: ElementInterface
        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.
        Specified by:
        apply in interface ElementInterface
        Overrides:
        apply in class BaseElement<R extends EntityReference>
        Parameters:
        newProperty - 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
      • isValueDirty

        public boolean isValueDirty()
        Returns:
        true if the property value doesn't match the value in the database.
        Since:
        4.3M2
      • setValueDirty

        protected void setValueDirty​(Object newValue)
        Set the dirty flag if the new value isn't equal to the old value.
        Parameters:
        newValue - The new value.
      • setValueDirty

        public void setValueDirty​(boolean valueDirty)
        Parameters:
        valueDirty - Indicate if the dirty flag should be set or cleared.
        Since:
        4.3M2
      • getPropertyClass

        public PropertyClass getPropertyClass​(XWikiContext xcontext)
        Parameters:
        xcontext - the XWiki Context
        Returns:
        the definition of the property
        Since:
        8.3M1