Package com.xpn.xwiki.objects
Class BaseObject
- java.lang.Object
-
- com.xpn.xwiki.objects.BaseElement<R>
-
- com.xpn.xwiki.objects.BaseCollection<BaseObjectReference>
-
- com.xpn.xwiki.objects.BaseObject
-
- All Implemented Interfaces:
ElementInterface,ObjectInterface,Serializable,Cloneable
public class BaseObject extends BaseCollection<BaseObjectReference> implements ObjectInterface, Serializable, Cloneable
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.xpn.xwiki.objects.BaseCollection
currentReferenceDocumentReferenceResolver, fields, fieldsToRemove, number, relativeEntityReferenceResolver
-
Fields inherited from class com.xpn.xwiki.objects.BaseElement
documentReference, ownerDocument, referenceCache
-
-
Constructor Summary
Constructors Constructor Description BaseObject()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BaseObjectclone()protected BaseObjectReferencecreateReference()voiddisplayEdit(StringBuffer buffer, String name, String prefix, XWikiContext context)StringdisplayEdit(String name, XWikiContext context)StringdisplayEdit(String name, String prefix, XWikiContext context)voiddisplayHidden(StringBuffer buffer, String name, String prefix, XWikiContext context)StringdisplayHidden(String name, XWikiContext context)StringdisplayHidden(String name, String prefix, XWikiContext context)voiddisplayView(StringBuffer buffer, String name, String prefix, XWikiContext context)StringdisplayView(String name, XWikiContext context)StringdisplayView(String name, String prefix, XWikiContext context)BaseObjectduplicate()Similar toclone()but whereas a clone is an exact copy (with the same GUID), a duplicate keeps the same data but with a different identity.BaseObjectduplicate(DocumentReference documentReference)booleanequals(Object obj)voidfromXML(org.dom4j.Element oel)List<ObjectDiff>getDiff(Object oldEntity, XWikiContext context)StringgetGuid()StringgetName()Deprecated.since 2.2M2 useBaseElement.getDocumentReference()inthashCode()protected voidmergeField(PropertyInterface currentElement, ElementInterface previousElement, ElementInterface newElement, MergeConfiguration configuration, XWikiContext context, MergeResult mergeResult)ObjectnewObjectApi(BaseObject obj, XWikiContext context)voidset(String fieldname, Object value, XWikiContext context)voidsetGuid(String guid)voidsetName(String name)Deprecated.voidsetNumber(int number)voidsetOwnerDocument(XWikiDocument ownerDocument)Set the owner document of this base object.voidsetXClassReference(EntityReference xClassReference)Set the reference to the XClass (used for an XObject).-
Methods inherited from class com.xpn.xwiki.objects.BaseCollection
addField, addPropertyForRemoval, apply, get, getClassName, getCurrentReferenceDocumentReferenceResolver, getCustomMappingMap, getDateValue, getDoubleValue, getField, getFieldList, getFieldsToRemove, getFloatValue, getIntValue, getIntValue, getLargeStringValue, getListValue, getLongValue, getNumber, getProperties, getPropertyList, getPropertyNames, getRelativeEntityReferenceResolver, getRelativeXClassReference, getSetValue, getSortedIterator, getStringValue, getXClass, getXClassReference, merge, merge, put, removeField, safeget, safeput, setClassName, setDateValue, setDBStringListValue, setDocumentReference, setDoubleValue, setFields, setFieldsToRemove, setFloatValue, setIntValue, setLargeStringValue, setLongValue, setSetValue, setStringListValue, setStringValue, toXML, toXML, toXMLString
-
Methods inherited from class com.xpn.xwiki.objects.BaseElement
fromXML, getDocumentReference, getId, getLocalEntityReferenceSerializer, getLocalization, getLocalKey, getLocalUidStringEntityReferenceSerializer, getMergeManager, getOwnerDocument, getPrettyName, getReference, getXWikiContext, localizePlain, localizePlainOrKey, merge, setId, setPrettyName, toString, toXMLString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.xpn.xwiki.objects.ElementInterface
apply, getDocumentReference, getReference, merge, merge, setDocumentReference, toString
-
-
-
-
Method Detail
-
getName
@Deprecated public String getName()
Deprecated.since 2.2M2 useBaseElement.getDocumentReference()Note that this method is used by Hibernate for saving an element.
Note: This method is overridden to add the deprecation warning so that code using it can see it's deprecated.
- Specified by:
getNamein interfaceElementInterface- Overrides:
getNamein classBaseElement<BaseObjectReference>- Returns:
- the free form name (for elements which don't point to a reference, for example for instances of
BaseProperty). - See Also:
ElementInterface.getName()
-
setName
@Deprecated public void setName(String name)
Deprecated.Note that this method is used by Hibernate for loading an element.
Note: BaseElement.setName() does not support setting reference anymore since 2.4M2.
- Specified by:
setNamein interfaceElementInterface- Overrides:
setNamein classBaseElement<BaseObjectReference>- See Also:
ElementInterface.setName(java.lang.String)
-
createReference
protected BaseObjectReference createReference()
- Overrides:
createReferencein classBaseElement<BaseObjectReference>
-
setNumber
public void setNumber(int number)
- Overrides:
setNumberin classBaseCollection<BaseObjectReference>
-
setXClassReference
public void setXClassReference(EntityReference xClassReference)
Description copied from class:BaseCollectionSet the reference to the XClass (used for an XObject).Note that absolute reference are not supported for xclasses which mean that the wiki part (whatever the wiki is) of the reference will be systematically removed.
- Overrides:
setXClassReferencein classBaseCollection<BaseObjectReference>- Parameters:
xClassReference- the reference to the XClass of this XObject.
-
displayHidden
public void displayHidden(StringBuffer buffer, String name, String prefix, XWikiContext context)
-
displayView
public void displayView(StringBuffer buffer, String name, String prefix, XWikiContext context)
-
displayEdit
public void displayEdit(StringBuffer buffer, String name, String prefix, XWikiContext context)
-
displayHidden
public String displayHidden(String name, String prefix, XWikiContext context)
-
displayView
public String displayView(String name, String prefix, XWikiContext context)
-
displayEdit
public String displayEdit(String name, String prefix, XWikiContext context)
-
displayHidden
public String displayHidden(String name, XWikiContext context)
-
displayView
public String displayView(String name, XWikiContext context)
-
displayEdit
public String displayEdit(String name, XWikiContext context)
-
clone
public BaseObject clone()
- Overrides:
clonein classBaseCollection<BaseObjectReference>
-
duplicate
public BaseObject duplicate()
Similar toclone()but whereas a clone is an exact copy (with the same GUID), a duplicate keeps the same data but with a different identity.- Since:
- 2.2.3
-
duplicate
public BaseObject duplicate(DocumentReference documentReference)
- Since:
- 2.2.3
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classBaseCollection<BaseObjectReference>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classBaseElement<BaseObjectReference>
-
fromXML
public void fromXML(org.dom4j.Element oel) throws XWikiException- Overrides:
fromXMLin classBaseElement<BaseObjectReference>- Throws:
XWikiException
-
getDiff
public List<ObjectDiff> getDiff(Object oldEntity, XWikiContext context)
- Overrides:
getDiffin classBaseCollection<BaseObjectReference>
-
newObjectApi
public Object newObjectApi(BaseObject obj, XWikiContext context)
-
set
public void set(String fieldname, Object value, XWikiContext context)
-
getGuid
public String getGuid()
- Returns:
- the unique identifier of the object, never null
-
setGuid
public void setGuid(String guid)
- Parameters:
guid- the unique identifier of the object, if null a new one will be generated
-
setOwnerDocument
public void setOwnerDocument(XWikiDocument ownerDocument)
Set the owner document of this base object.- Overrides:
setOwnerDocumentin classBaseCollection<BaseObjectReference>- Parameters:
ownerDocument- The owner document.- Since:
- 4.3M2
-
mergeField
protected void mergeField(PropertyInterface currentElement, ElementInterface previousElement, ElementInterface newElement, MergeConfiguration configuration, XWikiContext context, MergeResult mergeResult)
- Overrides:
mergeFieldin classBaseCollection<BaseObjectReference>
-
-