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 class
ListProperty.NotifyList
List implementation for updating dirty flag when updated.
-
Field Summary
Fields Modifier and Type Field Description protected List<String>
list
We 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 ListProperty
clone()
protected void
cloneInternal(BaseProperty clone)
Subclasses override this to copy values during cloning.boolean
equals(Object obj)
String
getFormStringSeparator()
Deprecated.since 7.0M2.List<String>
getList()
String
getTextValue()
This method is called by Hibernate to get the raw value to store in the database.Object
getValue()
protected MergeManagerResult<Object,Object>
mergeValue(Object previousValue, Object newValue, MergeConfiguration configuration)
Try to apply 3 ways merge on property value.void
setFormStringSeparator(String formStringSeparator)
Deprecated.since 7.0M2.void
setList(List<String> list)
Starting from 4.3M2, this method will copy the list passed as parameter.void
setValue(Object value)
String
toSingleFormString()
Deprecated.Since 7.0M2.String
toString()
String
toText()
-
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 inListClass
and 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 inListClass
and that is where they are now handled throughListClass.toFormString(BaseProperty)
.
-
getValue
public Object getValue()
- Overrides:
getValue
in classBaseProperty
-
setValue
public void setValue(Object value)
- Overrides:
setValue
in 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:
toText
in 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:
equals
in classBaseProperty
-
clone
public ListProperty clone()
- Specified by:
clone
in interfacePropertyInterface
- Overrides:
clone
in classBaseProperty
-
cloneInternal
protected void cloneInternal(BaseProperty clone)
Description copied from class:BaseProperty
Subclasses override this to copy values during cloning.- Overrides:
cloneInternal
in 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:
toString
in interfaceElementInterface
- Overrides:
toString
in classBaseElement
- See Also:
BaseElement.toString()
-
mergeValue
protected MergeManagerResult<Object,Object> mergeValue(Object previousValue, Object newValue, MergeConfiguration configuration)
Description copied from class:BaseProperty
Try to apply 3 ways merge on property value. Note that this method does not modify the internal value of the property.- Overrides:
mergeValue
in classBaseProperty
- Parameters:
previousValue
- the previous version of the valuenewValue
- the new version of the valueconfiguration
- the merge configuration to use
-
-