Class MultipleUserField
- java.lang.Object
-
- org.silverpeas.core.contribution.content.form.AbstractField
-
- org.silverpeas.core.contribution.content.form.field.MultipleUserField
-
- All Implemented Interfaces:
Serializable
,Comparable
,Field
public class MultipleUserField extends AbstractField
A UserField stores user references.- See Also:
Field
,FieldDisplayer
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
TYPE
The text field type name.-
Fields inherited from interface org.silverpeas.core.contribution.content.form.Field
FILE_PARAM_NAME_SUFFIX, TYPE_FILE
-
-
Constructor Summary
Constructors Constructor Description MultipleUserField()
The no parameters constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptObjectValue(Object value)
Returns true if the value is a String and this field isn't read only.boolean
acceptStringValue(String value)
Returns true if this field isn't read only.boolean
acceptValue(String value)
Always returns false since a user reference can't be computed from a user name.boolean
acceptValue(String value, String language)
Always returns false since a user reference can't be computed from a user name.int
compareTo(Object o)
Compares this field with the specified field.boolean
equals(Object o)
Tests equality between this field and the specified field.Object
getObjectValue()
Returns the User referenced by this field.String
getStringValue()
Returns this field value as a normalized String : a user idString
getTypeName()
Returns the type name.String[]
getUserIds()
Returns the user id referenced by this field.String
getValue()
Returns the string value of this field : aka the user name.String
getValue(String language)
Returns the local value of this field.int
hashCode()
boolean
isNull()
Returns true if this field is not set.boolean
isReadOnly()
Returns true if the value is read only.void
setNull()
Set to null this field.void
setObjectValue(Object value)
Set user referenced by this field.void
setStringValue(String value)
Set this field value from a normalized String : a user idvoid
setUserIds(String[] currentUserIds)
Set the user ids referenced by this field.void
setValue(String value)
Does nothing since a user reference can't be computed from a user name.void
setValue(String value, String language)
Does nothing since a user reference can't be computed from a user name.-
Methods inherited from class org.silverpeas.core.contribution.content.form.AbstractField
getName, getOccurrence, setName, setOccurrence
-
-
-
-
Field Detail
-
TYPE
public static final String TYPE
The text field type name.- See Also:
- Constant Field Values
-
-
Method Detail
-
getTypeName
public String getTypeName()
Returns the type name.- Specified by:
getTypeName
in interfaceField
- Specified by:
getTypeName
in classAbstractField
-
getUserIds
public String[] getUserIds()
Returns the user id referenced by this field.
-
setUserIds
public void setUserIds(String[] currentUserIds)
Set the user ids referenced by this field.
-
isReadOnly
public boolean isReadOnly()
Returns true if the value is read only.
-
getValue
public String getValue()
Returns the string value of this field : aka the user name.- Specified by:
getValue
in interfaceField
- Specified by:
getValue
in classAbstractField
-
getValue
public String getValue(String language)
Returns the local value of this field. There is no local format for a user field, so the language parameter is unused.- Specified by:
getValue
in interfaceField
- Specified by:
getValue
in classAbstractField
-
setValue
public void setValue(String value)
Does nothing since a user reference can't be computed from a user name.- Specified by:
setValue
in interfaceField
- Specified by:
setValue
in classAbstractField
-
setValue
public void setValue(String value, String language)
Does nothing since a user reference can't be computed from a user name.- Specified by:
setValue
in interfaceField
- Specified by:
setValue
in classAbstractField
- Throws:
FormException
-
acceptValue
public boolean acceptValue(String value)
Always returns false since a user reference can't be computed from a user name.- Specified by:
acceptValue
in interfaceField
- Specified by:
acceptValue
in classAbstractField
-
acceptValue
public boolean acceptValue(String value, String language)
Always returns false since a user reference can't be computed from a user name.- Specified by:
acceptValue
in interfaceField
- Specified by:
acceptValue
in classAbstractField
-
getObjectValue
public Object getObjectValue()
Returns the User referenced by this field.- Specified by:
getObjectValue
in interfaceField
- Specified by:
getObjectValue
in classAbstractField
-
setObjectValue
public void setObjectValue(Object value) throws FormException
Set user referenced by this field.- Specified by:
setObjectValue
in interfaceField
- Specified by:
setObjectValue
in classAbstractField
- Throws:
FormException
-
acceptObjectValue
public boolean acceptObjectValue(Object value)
Returns true if the value is a String and this field isn't read only.- Specified by:
acceptObjectValue
in interfaceField
- Specified by:
acceptObjectValue
in classAbstractField
-
getStringValue
public String getStringValue()
Returns this field value as a normalized String : a user id- Specified by:
getStringValue
in interfaceField
- Specified by:
getStringValue
in classAbstractField
-
setStringValue
public void setStringValue(String value)
Set this field value from a normalized String : a user id- Specified by:
setStringValue
in interfaceField
- Specified by:
setStringValue
in classAbstractField
-
acceptStringValue
public boolean acceptStringValue(String value)
Returns true if this field isn't read only.- Specified by:
acceptStringValue
in interfaceField
- Specified by:
acceptStringValue
in classAbstractField
-
isNull
public boolean isNull()
Returns true if this field is not set.- Specified by:
isNull
in interfaceField
- Specified by:
isNull
in classAbstractField
-
setNull
public void setNull() throws FormException
Set to null this field.- Specified by:
setNull
in interfaceField
- Specified by:
setNull
in classAbstractField
- Throws:
FormException
- when the field is read only or when the field is mandatory.
-
equals
public boolean equals(Object o)
Tests equality between this field and the specified field.
-
compareTo
public int compareTo(Object o)
Compares this field with the specified field. This is nonsense to compare arrays.- Specified by:
compareTo
in interfaceComparable
- Specified by:
compareTo
in classAbstractField
-
-