Class ExplorerField
- java.lang.Object
-
- org.silverpeas.core.contribution.content.form.AbstractField
-
- org.silverpeas.core.contribution.content.form.field.ExplorerField
-
- All Implemented Interfaces:
Serializable
,Comparable<Field>
,Field
public class ExplorerField extends AbstractField
An ExplorerField stores a node 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 ExplorerField()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptObjectValue(Object value)
Is this field able to accept the specified value?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(Field o)
boolean
equals(Object o)
String
getNodePK()
Gets the node id referenced by this field (ex: kmelia1-138)Object
getObjectValue()
Returns the User referenced by this field.String
getStringValue()
Returns this field value as a normalized String: a user idString
getTypeName()
Gets the type name of this field.String
getValue()
Gets the normalized value of this field.String
getValue(String language)
Gets the textual value of this field in the specified language.int
hashCode()
boolean
isNull()
Returns true if this field is not set.boolean
isReadOnly()
Is this field is read only?void
setNodePK(String pk)
Sets the node id to be referenced by this field.void
setNull()
Sets to null this field.void
setObjectValue(Object value)
Set node 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 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()
Description copied from interface:Field
Gets the type name of this field.- Returns:
- the name of this field type.
-
getNodePK
public String getNodePK()
Gets the node id referenced by this field (ex: kmelia1-138)- Returns:
- a node identifier.
-
setNodePK
public void setNodePK(String pk)
Sets the node id to be referenced by this field.- Parameters:
pk
- a node identifier.
-
isReadOnly
public boolean isReadOnly()
Is this field is read only?- Returns:
- true if the value is read only.
-
getValue
public String getValue()
Description copied from interface:Field
Gets the normalized value of this field.- Returns:
- the value of this field.
-
getValue
public String getValue(String language)
Description copied from interface:Field
Gets the textual value of this field in the specified language.- Parameters:
language
- the ISO-631 code of a supported language.- Returns:
- the value in the specified language.
-
setValue
public void setValue(String value) throws FormException
Does nothing since a user reference can't be computed from a user name.- Parameters:
value
- the normalized value to set.- Throws:
FormException
- when the field is readOnly or when the value format is wrong.
-
setValue
public void setValue(String value, String language) throws FormException
Does nothing since a user reference can't be computed from a user name.- Parameters:
value
- a textual value.language
- the ISO-631 code of a supported language.- Throws:
FormException
- when the field is readOnly or if the value isn't a text.
-
acceptValue
public boolean acceptValue(String value)
Always returns false since a user reference can't be computed from a user name.- Returns:
- true if the value format is correct and this field isn't read only. False otherwise.
-
acceptValue
public boolean acceptValue(String value, String language)
Always returns false since a user reference can't be computed from a user name.- Parameters:
value
- a textual value.language
- the ISO-631 code of a supported language.- Returns:
- true if the local value isn't ill formed and this field isn't read only.
-
getObjectValue
public Object getObjectValue()
Returns the User referenced by this field.- Returns:
- an object representing the value of this field.
-
setObjectValue
public void setObjectValue(Object value) throws FormException
Set node referenced by this field.- Parameters:
value
- anObject
representing the value to set.- Throws:
FormException
- when the field is readOnly or when the value has a wrong type.
-
acceptObjectValue
public boolean acceptObjectValue(Object value)
Description copied from interface:Field
Is this field able to accept the specified value?- Parameters:
value
- a value- Returns:
- true if the value hasn't a wrong type and this field isn't read only.
-
getStringValue
public String getStringValue()
Returns this field value as a normalized String: a user id- Returns:
- the
String
representation of the value of this field.
-
setStringValue
public void setStringValue(String value)
Set this field value from a normalized String: a user id- Parameters:
value
- theString
value to set
-
acceptStringValue
public boolean acceptStringValue(String value)
Returns true if this field isn't read only.- Parameters:
value
- aString
value.- Returns:
- true if the value isn't normalized and this field isn't read only.
-
isNull
public boolean isNull()
Returns true if this field is not set.- Returns:
- true if this field is not set. False otherwise.
-
setNull
public void setNull() throws FormException
Description copied from interface:Field
Sets to null this field.- Throws:
FormException
- when the field is mandatory or when the field is read only.
-
compareTo
public int compareTo(@Nonnull Field o)
-
-