Package com.xpn.xwiki.objects
Class ListProperty
- java.lang.Object
-
- com.xpn.xwiki.objects.BaseElement<R>
-
- com.xpn.xwiki.objects.BaseProperty
-
- com.xpn.xwiki.objects.ListProperty
-
- All Implemented Interfaces:
ElementInterface,PropertyInterface,Serializable,Cloneable
- Direct Known Subclasses:
DBStringListProperty,StringListProperty
public class ListProperty extends BaseProperty implements Cloneable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classListProperty.NotifyListList implementation for updating dirty flag when updated.
-
Field Summary
Fields Modifier and Type Field Description protected List<String>listWe make this a notifying list, because we must propagate any value updates to the owner document.-
Fields inherited from class com.xpn.xwiki.objects.BaseElement
documentReference, ownerDocument, referenceCache
-
-
Constructor Summary
Constructors Constructor Description ListProperty()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ListPropertyclone()protected voidcloneInternal(BaseProperty clone)Subclasses override this to copy values during cloning.booleanequals(Object obj)StringgetFormStringSeparator()Deprecated.since 7.0M2.List<String>getList()StringgetTextValue()This method is called by Hibernate to get the raw value to store in the database.ObjectgetValue()protected MergeManagerResult<Object,Object>mergeValue(Object previousValue, Object newValue, MergeConfiguration configuration)Try to apply 3 ways merge on property value.voidsetFormStringSeparator(String formStringSeparator)Deprecated.since 7.0M2.voidsetList(List<String> list)Starting from 4.3M2, this method will copy the list passed as parameter.voidsetValue(Object value)StringtoSingleFormString()Deprecated.Since 7.0M2.StringtoString()StringtoText()-
Methods inherited from class com.xpn.xwiki.objects.BaseProperty
apply, createReference, getClassType, getCustomMappingValue, getId, getObject, getPropertyClass, hashCode, isValueDirty, merge, merge, mergeValue, setClassType, setId, setObject, setOwnerDocument, setValueDirty, setValueDirty, toFormString, toXML, toXMLString
-
Methods inherited from class com.xpn.xwiki.objects.BaseElement
fromXML, fromXML, getDocumentReference, getLocalEntityReferenceSerializer, getLocalization, getLocalKey, getLocalUidStringEntityReferenceSerializer, getMergeManager, getName, getOwnerDocument, getPrettyName, getReference, getXWikiContext, localizePlain, localizePlainOrKey, setDocumentReference, setName, setPrettyName, toXMLString
-
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, setDocumentReference, setName
-
-
-
-
Method Detail
-
getFormStringSeparator
@Deprecated public String getFormStringSeparator()
Deprecated.since 7.0M2. This was never used, since it is not the right place to handle separators. They are defined inListClassand that is where they are now handled throughListClass.toFormString(BaseProperty).
-
setFormStringSeparator
@Deprecated public void setFormStringSeparator(String formStringSeparator)
Deprecated.since 7.0M2. This was never used, since it is not the right place to handle separators. They are defined inListClassand that is where they are now handled throughListClass.toFormString(BaseProperty).
-
getValue
public Object getValue()
- Overrides:
getValuein classBaseProperty
-
setValue
public void setValue(Object value)
- Overrides:
setValuein classBaseProperty
-
getTextValue
public String getTextValue()
This method is called by Hibernate to get the raw value to store in the database. Check the xwiki.hbm.xml file.- Returns:
- the string value that is saved in the database
-
toText
public String toText()
- Overrides:
toTextin classBaseProperty
-
toSingleFormString
@Deprecated public String toSingleFormString()
Deprecated.Since 7.0M2. This method is here for a long time but it does not seem to have ever been used and it does not bring any value compared to the existingBaseProperty.toFormString()method.
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classBaseProperty
-
clone
public ListProperty clone()
- Specified by:
clonein interfacePropertyInterface- Overrides:
clonein classBaseProperty
-
cloneInternal
protected void cloneInternal(BaseProperty clone)
Description copied from class:BasePropertySubclasses override this to copy values during cloning.- Overrides:
cloneInternalin classBaseProperty- Parameters:
clone- The cloned value.
-
setList
public void setList(List<String> list)
Starting from 4.3M2, this method will copy the list passed as parameter. Due to XWIKI-8398 we must be able to detect when the values in the list changes, so we cannot store the values in any type of list.- Parameters:
list- The list to copy.
-
toString
public String toString()
This is important.. Otherwise we can get a stackoverflow calling toXML().
- Specified by:
toStringin interfaceElementInterface- Overrides:
toStringin classBaseElement- See Also:
BaseElement.toString()
-
mergeValue
protected MergeManagerResult<Object,Object> mergeValue(Object previousValue, Object newValue, MergeConfiguration configuration)
Description copied from class:BasePropertyTry to apply 3 ways merge on property value. Note that this method does not modify the internal value of the property.- Overrides:
mergeValuein classBaseProperty- Parameters:
previousValue- the previous version of the valuenewValue- the new version of the valueconfiguration- the merge configuration to use
-
-