Class GroupField
- java.lang.Object
-
- org.silverpeas.core.contribution.content.form.AbstractField
-
- org.silverpeas.core.contribution.content.form.field.GroupField
-
- All Implemented Interfaces:
Serializable
,Comparable
,Field
public class GroupField extends AbstractField
A GroupField stores a group reference.- 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 GroupField()
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 group reference can't be computed from a group name.boolean
acceptValue(String value, String language)
Always returns false since a group reference can't be computed from a group 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.String
getGroupId()
Returns the user id referenced by this field.Object
getObjectValue()
Returns the Group referenced by this field.String
getStringValue()
Returns this field value as a normalized String : a group idString
getTypeName()
Returns the type name.String
getValue()
Returns the string value of this field : aka the group 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
setGroupId(String groupId)
Set the group id referenced by this field.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
setValue(String value)
Does nothing since a group reference can't be computed from a group name.void
setValue(String value, String language)
Does nothing since a group reference can't be computed from a group 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
-
getGroupId
public String getGroupId()
Returns the user id referenced by this field.
-
setGroupId
public void setGroupId(String groupId)
Set the group id 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 group 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 group field, so the language parameter is unused.- Specified by:
getValue
in interfaceField
- Specified by:
getValue
in classAbstractField
-
setValue
public void setValue(String value) throws FormException
Does nothing since a group reference can't be computed from a group name.- Specified by:
setValue
in interfaceField
- Specified by:
setValue
in classAbstractField
- Throws:
FormException
- when the field is readOnly or when the string value is ill formed.
-
setValue
public void setValue(String value, String language) throws FormException
Does nothing since a group reference can't be computed from a group name.- Specified by:
setValue
in interfaceField
- Specified by:
setValue
in classAbstractField
- Throws:
FormException
- when the field is readOnly or when the string value is ill formed.
-
acceptValue
public boolean acceptValue(String value)
Always returns false since a group reference can't be computed from a group name.- Specified by:
acceptValue
in interfaceField
- Specified by:
acceptValue
in classAbstractField
-
acceptValue
public boolean acceptValue(String value, String language)
Always returns false since a group reference can't be computed from a group name.- Specified by:
acceptValue
in interfaceField
- Specified by:
acceptValue
in classAbstractField
-
getObjectValue
public Object getObjectValue()
Returns the Group 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
- when the field is readOnly or when the value has a wrong type.
-
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 group 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 mandatory or when the field is read only.
-
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.- Specified by:
compareTo
in interfaceComparable
- Specified by:
compareTo
in classAbstractField
-
-