com.xpn.xwiki.objects
Class BaseObject

java.lang.Object
  extended by com.xpn.xwiki.objects.BaseElement<R>
      extended by com.xpn.xwiki.objects.BaseCollection<BaseObjectReference>
          extended by 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
localEntityReferenceSerializer, referenceCache
 
Constructor Summary
BaseObject()
           
 
Method Summary
 BaseObject clone()
           
protected  BaseObjectReference createReference()
           
 void displayEdit(StringBuffer buffer, String name, String prefix, XWikiContext context)
           
 String displayEdit(String name, String prefix, XWikiContext context)
           
 String displayEdit(String name, XWikiContext context)
           
 void displayHidden(StringBuffer buffer, String name, String prefix, XWikiContext context)
           
 String displayHidden(String name, String prefix, XWikiContext context)
           
 String displayHidden(String name, XWikiContext context)
           
 void displayView(StringBuffer buffer, String name, String prefix, XWikiContext context)
           
 String displayView(String name, String prefix, XWikiContext context)
           
 String displayView(String name, XWikiContext context)
           
 BaseObject duplicate()
          Similar to clone() but whereas a clone is an exact copy (with the same GUID), a duplicate keeps the same data but with a different identity.
 BaseObject duplicate(DocumentReference documentReference)
           
 boolean equals(Object obj)
           
 void fromXML(org.dom4j.Element oel)
           
 List<ObjectDiff> getDiff(Object oldEntity, XWikiContext context)
           
 String getGuid()
           
 String getName()
          Deprecated. since 2.2M2 use BaseElement.getDocumentReference()
 Object newObjectApi(BaseObject obj, XWikiContext context)
           
 void set(String fieldname, Object value, XWikiContext context)
           
 void setGuid(String guid)
           
 void setName(String name)
          Deprecated. since 2.2M2 use BaseCollection.setDocumentReference(org.xwiki.model.reference.DocumentReference)
 void setNumber(int number)
           
 void setOwnerDocument(XWikiDocument ownerDocument)
          Set the owner document of this base object.
 void setXClassReference(EntityReference xClassReference)
          Set the reference to the XClass (used for an XObject).
 org.dom4j.Element toXML(BaseClass bclass)
           
 
Methods inherited from class com.xpn.xwiki.objects.BaseCollection
addField, addPropertyForRemoval, apply, get, getClassName, getCustomMappingMap, getDateValue, getDoubleValue, getField, getFieldList, getFieldsToRemove, getFloatValue, getIntValue, getIntValue, getLargeStringValue, getListValue, getLongValue, getNumber, getProperties, getPropertyList, getPropertyNames, 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, toString, toXMLString
 
Methods inherited from class com.xpn.xwiki.objects.BaseElement
getDocumentReference, getId, getLocalKey, getLocalUidStringEntityReferenceSerializer, getPrettyName, getReference, hashCode, setId, setPrettyName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.xpn.xwiki.objects.ObjectInterface
get, getXClass, put, safeget, safeput
 
Methods inherited from interface com.xpn.xwiki.objects.ElementInterface
apply, getDocumentReference, getReference, merge, setDocumentReference, toString
 

Constructor Detail

BaseObject

public BaseObject()
Method Detail

getName

@Deprecated
public String getName()
Deprecated. since 2.2M2 use BaseElement.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:
getName in interface ElementInterface
Overrides:
getName in class BaseElement<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. since 2.2M2 use BaseCollection.setDocumentReference(org.xwiki.model.reference.DocumentReference)

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:
setName in interface ElementInterface
Overrides:
setName in class BaseCollection<BaseObjectReference>
See Also:
ElementInterface.setName(java.lang.String)

createReference

protected BaseObjectReference createReference()
Overrides:
createReference in class BaseElement<BaseObjectReference>

setNumber

public void setNumber(int number)
Overrides:
setNumber in class BaseCollection<BaseObjectReference>

setXClassReference

public void setXClassReference(EntityReference xClassReference)
Description copied from class: BaseCollection
Set 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:
setXClassReference in class BaseCollection<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:
clone in class BaseCollection<BaseObjectReference>

duplicate

public BaseObject duplicate()
Similar to clone() 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:
equals in class BaseCollection<BaseObjectReference>

toXML

public org.dom4j.Element toXML(BaseClass bclass)
Specified by:
toXML in interface ObjectInterface
Specified by:
toXML in class BaseCollection<BaseObjectReference>

fromXML

public void fromXML(org.dom4j.Element oel)
             throws XWikiException
Throws:
XWikiException

getDiff

public List<ObjectDiff> getDiff(Object oldEntity,
                                XWikiContext context)
Overrides:
getDiff in class BaseCollection<BaseObjectReference>

newObjectApi

public Object newObjectApi(BaseObject obj,
                           XWikiContext context)

set

public void set(String fieldname,
                Object value,
                XWikiContext context)

getGuid

public String getGuid()

setGuid

public void setGuid(String guid)

setOwnerDocument

public void setOwnerDocument(XWikiDocument ownerDocument)
Set the owner document of this base object.

Parameters:
ownerDocument - The owner document.
Since:
4.3M2


Copyright © 2004-2013 XWiki. All Rights Reserved.