|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xpn.xwiki.objects.BaseElement<R>
com.xpn.xwiki.objects.BaseCollection<R>
public abstract class BaseCollection<R extends EntityReference>
Base class for representing an element having a collection of properties. For example:
Field Summary | |
---|---|
protected DocumentReferenceResolver<EntityReference> |
currentReferenceDocumentReferenceResolver
Used to normalize references. |
protected Map<String,Object> |
fields
List of properties (eg XClass properties, XObject properties, etc). |
protected List |
fieldsToRemove
|
protected int |
number
The meaning of this reference fields depends on the element represented. |
protected EntityReferenceResolver<String> |
relativeEntityReferenceResolver
Used to resolve XClass references in the way they are stored externally (database, xml, etc), ie relative or absolute. |
Fields inherited from class com.xpn.xwiki.objects.BaseElement |
---|
localEntityReferenceSerializer, referenceCache |
Constructor Summary | |
---|---|
BaseCollection()
|
Method Summary | |
---|---|
void |
addField(String name,
PropertyInterface element)
|
void |
addPropertyForRemoval(PropertyInterface field)
|
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. |
BaseCollection |
clone()
|
boolean |
equals(Object coll)
|
PropertyInterface |
get(String name)
|
String |
getClassName()
Deprecated. since 2.2M2 use getXClassReference() instead |
Map<String,Object> |
getCustomMappingMap()
|
Date |
getDateValue(String name)
|
List<ObjectDiff> |
getDiff(Object oldObject,
XWikiContext context)
|
double |
getDoubleValue(String name)
|
PropertyInterface |
getField(String name)
|
Collection |
getFieldList()
|
List |
getFieldsToRemove()
|
float |
getFloatValue(String name)
|
int |
getIntValue(String name)
|
int |
getIntValue(String name,
int default_value)
|
String |
getLargeStringValue(String name)
|
List |
getListValue(String name)
|
long |
getLongValue(String name)
|
int |
getNumber()
|
Object[] |
getProperties()
|
Set<String> |
getPropertyList()
|
String[] |
getPropertyNames()
|
EntityReference |
getRelativeXClassReference()
Get the actual reference to the XClass as stored in this instance. |
Set<?> |
getSetValue(String name)
|
Iterator |
getSortedIterator()
Return an iterator that will operate on a collection of values (as would be returned by getProperties or getFieldList) sorted by their name (ElementInterface.getName()). |
String |
getStringValue(String name)
|
BaseClass |
getXClass(XWikiContext context)
|
DocumentReference |
getXClassReference()
Get the absolute reference of the XClass. |
void |
merge(BaseObject object)
|
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 |
put(String name,
PropertyInterface property)
|
void |
removeField(String name)
|
PropertyInterface |
safeget(String name)
|
void |
safeput(String name,
PropertyInterface property)
|
void |
setClassName(String name)
Deprecated. since 2.2.3 use setXClassReference(EntityReference) ()} instead |
void |
setDateValue(String name,
Date value)
|
void |
setDBStringListValue(String name,
List value)
|
void |
setDocumentReference(DocumentReference reference)
|
void |
setDoubleValue(String name,
double value)
|
void |
setFields(Map fields)
|
void |
setFieldsToRemove(List fieldsToRemove)
|
void |
setFloatValue(String name,
float value)
|
void |
setIntValue(String name,
int value)
|
void |
setLargeStringValue(String name,
String value)
|
void |
setLongValue(String name,
long value)
|
void |
setName(String name)
Note that this method is used by Hibernate for loading an element. |
void |
setNumber(int number)
|
void |
setSetValue(String name,
Set<?> value)
|
void |
setStringListValue(String name,
List value)
|
void |
setStringValue(String name,
String value)
|
void |
setXClassReference(EntityReference xClassReference)
Set the reference to the XClass (used for an XObject). |
String |
toString()
|
abstract org.dom4j.Element |
toXML(BaseClass bclass)
|
String |
toXMLString()
|
Methods inherited from class com.xpn.xwiki.objects.BaseElement |
---|
createReference, getDocumentReference, getId, getLocalKey, getLocalUidStringEntityReferenceSerializer, getName, 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.ElementInterface |
---|
getDocumentReference, getName, getReference |
Field Detail |
---|
protected Map<String,Object> fields
protected List fieldsToRemove
protected int number
protected EntityReferenceResolver<String> relativeEntityReferenceResolver
protected DocumentReferenceResolver<EntityReference> currentReferenceDocumentReferenceResolver
Constructor Detail |
---|
public BaseCollection()
Method Detail |
---|
public int getNumber()
public void setNumber(int number)
public void addPropertyForRemoval(PropertyInterface field)
public DocumentReference getXClassReference()
public EntityReference getRelativeXClassReference()
@Deprecated public String getClassName()
getXClassReference()
instead
public void setXClassReference(EntityReference xClassReference)
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.
xClassReference
- the reference to the XClass of this XObject.@Deprecated public void setClassName(String name)
setXClassReference(EntityReference)
()} instead
public PropertyInterface safeget(String name)
safeget
in interface ObjectInterface
public PropertyInterface get(String name) throws XWikiException
get
in interface ObjectInterface
XWikiException
public void safeput(String name, PropertyInterface property)
safeput
in interface ObjectInterface
public void put(String name, PropertyInterface property) throws XWikiException
put
in interface ObjectInterface
XWikiException
public BaseClass getXClass(XWikiContext context)
getXClass
in interface ObjectInterface
public String getStringValue(String name)
public String getLargeStringValue(String name)
public void setStringValue(String name, String value)
public void setLargeStringValue(String name, String value)
public int getIntValue(String name)
public int getIntValue(String name, int default_value)
public void setIntValue(String name, int value)
public long getLongValue(String name)
public void setLongValue(String name, long value)
public float getFloatValue(String name)
public void setFloatValue(String name, float value)
public double getDoubleValue(String name)
public void setDoubleValue(String name, double value)
public Date getDateValue(String name)
public void setDateValue(String name, Date value)
public Set<?> getSetValue(String name)
public void setSetValue(String name, Set<?> value)
public List getListValue(String name)
public void setStringListValue(String name, List value)
public void setDBStringListValue(String name, List value)
public void setFields(Map fields)
public PropertyInterface getField(String name)
public void addField(String name, PropertyInterface element)
public void removeField(String name)
public Collection getFieldList()
public Set<String> getPropertyList()
public Object[] getProperties()
public String[] getPropertyNames()
public Iterator getSortedIterator()
public boolean equals(Object coll)
equals
in class BaseElement<R extends EntityReference>
public BaseCollection clone()
clone
in class BaseElement<R extends EntityReference>
public void merge(BaseObject object)
public List<ObjectDiff> getDiff(Object oldObject, XWikiContext context)
public List getFieldsToRemove()
public void setFieldsToRemove(List fieldsToRemove)
public abstract org.dom4j.Element toXML(BaseClass bclass)
toXML
in interface ObjectInterface
public String toXMLString()
public String toString()
toString
in interface ElementInterface
toString
in class Object
public Map<String,Object> getCustomMappingMap() throws XWikiException
XWikiException
public void setDocumentReference(DocumentReference reference)
setDocumentReference
in interface ElementInterface
setDocumentReference
in class BaseElement<R extends EntityReference>
public void setName(String name)
BaseElement
setName
in interface ElementInterface
setName
in class BaseElement<R extends EntityReference>
ElementInterface.setName(java.lang.String)
public void merge(ElementInterface previousElement, ElementInterface newElement, MergeConfiguration configuration, XWikiContext context, MergeResult mergeResult)
ElementInterface
All 3 elements are supposed to have the same class and reference.
merge
in interface ElementInterface
merge
in class BaseElement<R extends EntityReference>
previousElement
- the previous version of the elementnewElement
- the next version of the elementconfiguration
- the configuration of the merge Indicate how to deal with some conflicts use cases, etc.context
- the XWiki contextmergeResult
- the merge reportpublic boolean apply(ElementInterface newElement, boolean clean)
ElementInterface
apply
in interface ElementInterface
apply
in class BaseElement<R extends EntityReference>
newElement
- the element to applyclean
- true if informations that are not in the new element should be removed (for example class properties
not in the new class)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |