com.xpn.xwiki.objects
Class ListProperty

java.lang.Object
  extended by com.xpn.xwiki.objects.BaseElement<R>
      extended by com.xpn.xwiki.objects.BaseProperty
          extended by 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
static class ListProperty.NotifyList
          List implementation for updating dirty flag when updated.
 
Field Summary
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
localEntityReferenceSerializer, referenceCache
 
Constructor Summary
ListProperty()
           
 
Method Summary
 ListProperty clone()
           
protected  void cloneInternal(BaseProperty clone)
          Subclasses override this to copy values during cloning.
 boolean equals(Object obj)
           
 String getFormStringSeparator()
           
 List<String> getList()
           
 String getTextValue()
          This method is called by Hibernate to get the raw value to store in the database.
 Object getValue()
           
protected  void mergeValue(Object previousValue, Object newValue, MergeResult mergeResult)
          Try to apply 3 ways merge on property value.
 void setFormStringSeparator(String formStringSeparator)
           
 void setList(List<String> list)
          Starting from 4.3M2, this method will copy the list passed as parameter.
 void setValue(Object value)
           
 String toSingleFormString()
           
 String toString()
          
 String toText()
           
 org.dom4j.Element toXML()
           
 
Methods inherited from class com.xpn.xwiki.objects.BaseProperty
apply, createReference, getClassType, getCustomMappingValue, getId, getObject, hashCode, isValueDirty, merge, setClassType, setId, setObject, setOwnerDocument, setValueDirty, setValueDirty, toFormString, toXMLString
 
Methods inherited from class com.xpn.xwiki.objects.BaseElement
getDocumentReference, getLocalKey, getLocalUidStringEntityReferenceSerializer, getName, getPrettyName, getReference, setDocumentReference, setName, 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, setDocumentReference, setName
 

Field Detail

list

protected transient List<String> list
We make this a notifying list, because we must propagate any value updates to the owner document.

Constructor Detail

ListProperty

public ListProperty()
Method Detail

getFormStringSeparator

public String getFormStringSeparator()

setFormStringSeparator

public void setFormStringSeparator(String formStringSeparator)

getValue

public Object getValue()
Overrides:
getValue in class BaseProperty

setValue

public void setValue(Object value)
Overrides:
setValue in class BaseProperty

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 class BaseProperty

toSingleFormString

public String toSingleFormString()

equals

public boolean equals(Object obj)
Overrides:
equals in class BaseProperty

clone

public ListProperty clone()
Specified by:
clone in interface PropertyInterface
Overrides:
clone in class BaseProperty

cloneInternal

protected void cloneInternal(BaseProperty clone)
Description copied from class: BaseProperty
Subclasses override this to copy values during cloning.

Overrides:
cloneInternal in class BaseProperty
Parameters:
clone - The cloned value.

getList

public List<String> getList()

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.

toXML

public org.dom4j.Element toXML()
Specified by:
toXML in interface PropertyInterface
Overrides:
toXML in class BaseProperty

toString

public String toString()

This is important.. Otherwise we can get a stackoverflow calling toXML()

Specified by:
toString in interface ElementInterface
Overrides:
toString in class BaseProperty
See Also:
BaseProperty.toString()

mergeValue

protected void mergeValue(Object previousValue,
                          Object newValue,
                          MergeResult mergeResult)
Description copied from class: BaseProperty
Try to apply 3 ways merge on property value.

Overrides:
mergeValue in class BaseProperty
Parameters:
previousValue - the previous version of the value
newValue - the new version of the value
mergeResult - merge report


Copyright © 2004-2013 XWiki. All Rights Reserved.