com.xpn.xwiki.objects
Interface ElementInterface

All Known Subinterfaces:
ClassInterface, ObjectInterface, PropertyClassInterface, PropertyInterface
All Known Implementing Classes:
BaseClass, BaseCollection, BaseElement, BaseObject, BaseProperty, BaseStringProperty, BooleanClass, BooleanMetaClass, ComputedFieldClass, ComputedFieldMetaClass, DateClass, DateMetaClass, DateProperty, DBListClass, DBListMetaClass, DBStringListProperty, DBTreeListClass, DBTreeListMetaClass, DocumentStats, DoubleProperty, EmailClass, EmailMetaClass, FloatProperty, GroupsClass, GroupsMetaClass, IntegerProperty, LargeStringProperty, LevelsClass, LevelsMetaClass, ListClass, ListMetaClass, ListProperty, LongProperty, MetaClass, NumberClass, NumberMetaClass, NumberProperty, PageClass, PageMetaClass, PasswordClass, PasswordMetaClass, PropertyClass, PropertyMetaClass, RefererStats, StaticListClass, StaticListMetaClass, StringClass, StringListProperty, StringMetaClass, StringProperty, TextAreaClass, TextAreaMetaClass, UsersClass, UsersMetaClass, VisitStats, XWikiStats

public interface ElementInterface


Method Summary
 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.
 DocumentReference getDocumentReference()
           
 String getName()
           
 EntityReference getReference()
           
 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.
 void setDocumentReference(DocumentReference reference)
           
 void setName(String name)
           
 String toString()
           
 

Method Detail

getReference

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

toString

String toString()
Overrides:
toString in class Object

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


Copyright © 2004–2014 XWiki. All rights reserved.