com.xpn.xwiki.objects.classes
Class ListClass

java.lang.Object
  extended by com.xpn.xwiki.objects.BaseElement<R>
      extended by com.xpn.xwiki.objects.BaseCollection<ClassPropertyReference>
          extended by com.xpn.xwiki.objects.classes.PropertyClass
              extended by com.xpn.xwiki.objects.classes.ListClass
All Implemented Interfaces:
PropertyClassInterface, ElementInterface, ObjectInterface, PropertyInterface, Serializable, Cloneable, Comparable<PropertyClass>
Direct Known Subclasses:
DBListClass, GroupsClass, LevelsClass, StaticListClass, UsersClass

public abstract class ListClass
extends PropertyClass

See Also:
Serialized Form

Nested Class Summary
protected  class ListClass.MapComparator
           
 
Field Summary
 
Fields inherited from class com.xpn.xwiki.objects.classes.PropertyClass
cachedCustomDisplayer
 
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
ListClass()
           
ListClass(PropertyMetaClass wclass)
           
ListClass(String name, String prettyname, PropertyMetaClass wclass)
           
 
Method Summary
 void displayEdit(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context)
           
 void displayHidden(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context)
           
protected  void displayRadioEdit(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context)
           
protected  void displaySelectEdit(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context)
           
 void displayView(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context)
           
 BaseProperty fromString(String value)
           
 BaseProperty fromStringArray(String[] strings)
           
 String getDisplayType()
           
protected  String getDisplayValue(Object rawvalue, String name, Map<String,ListItem> map, XWikiContext context)
          Search for an internationalizable display text for the current value.
protected  String getDisplayValue(String value, String name, Map<String,ListItem> map, XWikiContext context)
          Search for an internationalizable display text for the current value.
protected  String getElementValue(Object rawvalue)
          If the list is populated with value=name pairs selected from the database, then return only the value.
abstract  List<String> getList(XWikiContext context)
           
static List<String> getListFromString(String value)
           
static List<String> getListFromString(String value, String separators, boolean withMap)
           
abstract  Map<String,ListItem> getMap(XWikiContext context)
           
static Map<String,ListItem> getMapFromString(String value)
           
 String getSeparator()
           
 String getSeparators()
           
 int getSize()
           
 String getSort()
           
 boolean isCache()
           
 boolean isMultiSelect()
           
 boolean isPicker()
           
 boolean isRelationalStorage()
           
 BaseProperty newProperty()
           
 BaseProperty newPropertyfromXML(org.dom4j.Element ppcel)
           
 void setCache(boolean cache)
           
 void setDisplayType(String type)
           
 void setMultiSelect(boolean multiSelect)
           
 void setPicker(boolean picker)
           
 void setRelationalStorage(boolean storage)
           
 void setSeparator(String separator)
           
 void setSeparators(String separators)
           
 void setSize(int size)
           
 void setSort(String sort)
           
 
Methods inherited from class com.xpn.xwiki.objects.classes.PropertyClass
clone, compareTo, createReference, displayCustom, displayEdit, displayEdit, displayHidden, displayHidden, displayView, displayView, flushCache, fromValue, fromXML, getCachedDefaultCustomDisplayer, getClassName, getClassType, getCustomDisplay, getDefaultCustomDisplayer, getFieldFullName, getFullQueryPropertyName, getId, getName, getNumber, getObject, getPrettyName, getPrettyName, getTooltip, getTooltip, getTranslatedPrettyName, getValidationMessage, getValidationRegExp, getXClass, getxWikiClass, initLazyCollections, isCustomDisplayed, isDisabled, isUnmodifiable, isValidColumnTypes, setClassType, setCustomDisplay, setDisabled, setId, setName, setNumber, setObject, setPrettyName, setTooltip, setUnmodifiable, setValidationMessage, setValidationRegExp, setxWikiClass, toFormString, toString, toXML, toXML, validateProperty
 
Methods inherited from class com.xpn.xwiki.objects.BaseCollection
addField, addPropertyForRemoval, apply, equals, get, getCustomMappingMap, getDateValue, getDiff, getDoubleValue, getField, getFieldList, getFieldsToRemove, getFloatValue, getIntValue, getIntValue, getLargeStringValue, getListValue, getLongValue, getProperties, getPropertyList, getPropertyNames, getRelativeXClassReference, getSetValue, getSortedIterator, getStringValue, getXClassReference, merge, merge, put, removeField, safeget, safeput, setClassName, setDateValue, setDBStringListValue, setDocumentReference, setDoubleValue, setFields, setFieldsToRemove, setFloatValue, setIntValue, setLargeStringValue, setLongValue, setSetValue, setStringListValue, setStringValue, setXClassReference, toString, toXMLString
 
Methods inherited from class com.xpn.xwiki.objects.BaseElement
getDocumentReference, getLocalKey, getLocalUidStringEntityReferenceSerializer, getReference, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.xpn.xwiki.objects.ObjectInterface
get, put, safeget, safeput
 
Methods inherited from interface com.xpn.xwiki.objects.ElementInterface
apply, getDocumentReference, getReference, merge, setDocumentReference, toString
 

Constructor Detail

ListClass

public ListClass(String name,
                 String prettyname,
                 PropertyMetaClass wclass)

ListClass

public ListClass(PropertyMetaClass wclass)

ListClass

public ListClass()
Method Detail

getSeparators

public String getSeparators()

setSeparators

public void setSeparators(String separators)

getDisplayType

public String getDisplayType()

setDisplayType

public void setDisplayType(String type)

getSort

public String getSort()

setSort

public void setSort(String sort)

getSize

public int getSize()

setSize

public void setSize(int size)

isCache

public boolean isCache()

setCache

public void setCache(boolean cache)

isMultiSelect

public boolean isMultiSelect()

setMultiSelect

public void setMultiSelect(boolean multiSelect)

isRelationalStorage

public boolean isRelationalStorage()

setRelationalStorage

public void setRelationalStorage(boolean storage)

isPicker

public boolean isPicker()

setPicker

public void setPicker(boolean picker)

getSeparator

public String getSeparator()

setSeparator

public void setSeparator(String separator)

getListFromString

public static List<String> getListFromString(String value)

getListFromString

public static List<String> getListFromString(String value,
                                             String separators,
                                             boolean withMap)

getMapFromString

public static Map<String,ListItem> getMapFromString(String value)

newProperty

public BaseProperty newProperty()
Specified by:
newProperty in interface PropertyClassInterface
Overrides:
newProperty in class PropertyClass

fromString

public BaseProperty fromString(String value)
Specified by:
fromString in interface PropertyClassInterface
Overrides:
fromString in class PropertyClass

fromStringArray

public BaseProperty fromStringArray(String[] strings)
Overrides:
fromStringArray in class PropertyClass

newPropertyfromXML

public BaseProperty newPropertyfromXML(org.dom4j.Element ppcel)
Overrides:
newPropertyfromXML in class PropertyClass

getDisplayValue

protected String getDisplayValue(String value,
                                 String name,
                                 Map<String,ListItem> map,
                                 XWikiContext context)
Search for an internationalizable display text for the current value. The search process is:
  1. let V = the internal value of the option, used as the "value" attribute of the
  2. if a message with the key _ exists, return it as D
  3. else, if a message with the key option__ exists, return it as D
  4. else, if a message with the key option_ exists, return it as D
  5. else, D can be specified in the values parameter of the property by using V=D
  6. else return V

Parameters:
value - The internal value.
name - The name of the ListProperty.
map - The value=name mapping specified in the "values" parameter of the property.
context - The request context.
Returns:
The text that should be displayed, representing a human-understandable name for the internal value.

getDisplayValue

protected String getDisplayValue(Object rawvalue,
                                 String name,
                                 Map<String,ListItem> map,
                                 XWikiContext context)
Search for an internationalizable display text for the current value. The value can be either a simple string, or a value=name pair selected from the database.

Parameters:
rawvalue - The internal value, or a value=name pair.
name - The name of the ListProperty.
map - The value=name mapping specified in the "values" parameter of the property.
context - The request context.
Returns:
The text that should be displayed, representing a human-understandable name for the internal value.
See Also:
getDisplayValue(String, String, Map, XWikiContext)

getElementValue

protected String getElementValue(Object rawvalue)
If the list is populated with value=name pairs selected from the database, then return only the value. Otherwise, it is a simple value.

Parameters:
rawvalue -
Returns:
The list value

displayHidden

public void displayHidden(StringBuffer buffer,
                          String name,
                          String prefix,
                          BaseCollection object,
                          XWikiContext context)
Specified by:
displayHidden in interface PropertyClassInterface
Overrides:
displayHidden in class PropertyClass

displayView

public void displayView(StringBuffer buffer,
                        String name,
                        String prefix,
                        BaseCollection object,
                        XWikiContext context)
Specified by:
displayView in interface PropertyClassInterface
Overrides:
displayView in class PropertyClass

displayEdit

public void displayEdit(StringBuffer buffer,
                        String name,
                        String prefix,
                        BaseCollection object,
                        XWikiContext context)
Specified by:
displayEdit in interface PropertyClassInterface
Overrides:
displayEdit in class PropertyClass

displayRadioEdit

protected void displayRadioEdit(StringBuffer buffer,
                                String name,
                                String prefix,
                                BaseCollection object,
                                XWikiContext context)

displaySelectEdit

protected void displaySelectEdit(StringBuffer buffer,
                                 String name,
                                 String prefix,
                                 BaseCollection object,
                                 XWikiContext context)

getList

public abstract List<String> getList(XWikiContext context)

getMap

public abstract Map<String,ListItem> getMap(XWikiContext context)


Copyright © 2004-2013 XWiki. All Rights Reserved.