Class DummyDataRecord
- java.lang.Object
-
- org.silverpeas.core.contribution.content.form.dummy.DummyDataRecord
-
- All Implemented Interfaces:
Serializable
,DataRecord
- Direct Known Subclasses:
DummyFileDataRecord
public class DummyDataRecord extends Object implements DataRecord
A dummy DataRecord .- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DummyDataRecord()
DummyDataRecord(Field field)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Field
getField(int fieldIndex)
Gets the field at the index position in this data record.Field
getField(String fieldName)
Gets the specified named field.Field
getField(String fieldName, int occurrence)
Gets the nth occurrence of the specified named field.String[]
getFieldNames()
Gets the name of all the fields set in this data record.String
getId()
Returns the data record identifier.String
getLanguage()
Gets the language in which any text valued some of the fields are.ResourceReference
getResourceReference()
Gets the reference to the resource in Silverpeas to which this data record belongs.Map<String,String>
getValues(String language)
Gets a dictionary of all field values, each of them mapped to the name of their corresponding field.boolean
isNew()
Is this data record a new one?void
setId(String externalId)
Gives an id to the data record.void
setLanguage(String language)
Sets the language in which the text fields are valued.int
size()
Gets the size of this data record or -1 whether this operation isn't supported.
-
-
-
Constructor Detail
-
DummyDataRecord
public DummyDataRecord()
-
DummyDataRecord
public DummyDataRecord(Field field)
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:DataRecord
Returns the data record identifier. This id is unique within theRecordSet
from witch this data record has been get. This id is null when it has been built from aRecordTemplate
but not yet inserted into aRecordSet
.- Specified by:
getId
in interfaceDataRecord
-
setId
public void setId(String externalId)
Description copied from interface:DataRecord
Gives an id to the data record. This id must be set before the record is inserted in aRecordSet
.- Specified by:
setId
in interfaceDataRecord
- Parameters:
externalId
- the identifier to set to this data record.
-
isNew
public boolean isNew()
Description copied from interface:DataRecord
Is this data record a new one?- Specified by:
isNew
in interfaceDataRecord
- Returns:
- true if this record has not been inserted in a
RecordSet
. False otherwise.
-
getField
public Field getField(String fieldName)
Description copied from interface:DataRecord
Gets the specified named field. If there is several fields with the given name, then only the first one is returned.- Specified by:
getField
in interfaceDataRecord
- Parameters:
fieldName
- the name of a field.- Returns:
- the named field or, in the case there is no such field, either null or an empty field.
-
getField
public Field getField(String fieldName, int occurrence)
Description copied from interface:DataRecord
Gets the nth occurrence of the specified named field.- Specified by:
getField
in interfaceDataRecord
- Parameters:
fieldName
- the name of a field.occurrence
- the nth occurrence of such a field.- Returns:
- the named field or, in the case there is no such field, either null or an empty field.
-
getField
public Field getField(int fieldIndex)
Description copied from interface:DataRecord
Gets the field at the index position in this data record.- Specified by:
getField
in interfaceDataRecord
- Parameters:
fieldIndex
- the index of the field in the data record.- Returns:
- the field or, in the case there is no such field, either null or an empty field.
-
size
public int size()
Description copied from interface:DataRecord
Gets the size of this data record or -1 whether this operation isn't supported.- Specified by:
size
in interfaceDataRecord
- Returns:
- the total number of fields making this record, whatever their name. If this method isn't supported, -1 is returned.
-
getFieldNames
public String[] getFieldNames()
Description copied from interface:DataRecord
Gets the name of all the fields set in this data record.- Specified by:
getFieldNames
in interfaceDataRecord
- Returns:
- an array with the name of the fields.
-
getLanguage
public String getLanguage()
Description copied from interface:DataRecord
Gets the language in which any text valued some of the fields are.- Specified by:
getLanguage
in interfaceDataRecord
- Returns:
- the ISO-631 code of a supported language.
-
setLanguage
public void setLanguage(String language)
Description copied from interface:DataRecord
Sets the language in which the text fields are valued.- Specified by:
setLanguage
in interfaceDataRecord
- Parameters:
language
- the ISO-631 code of a supported language.
-
getValues
public Map<String,String> getValues(String language)
Description copied from interface:DataRecord
Gets a dictionary of all field values, each of them mapped to the name of their corresponding field.- Specified by:
getValues
in interfaceDataRecord
- Parameters:
language
- the language in which are the valued the text fields.- Returns:
- a
Map
of field values mapped to their corresponding field name.
-
getResourceReference
public ResourceReference getResourceReference()
Description copied from interface:DataRecord
Gets the reference to the resource in Silverpeas to which this data record belongs.- Specified by:
getResourceReference
in interfaceDataRecord
- Returns:
- a reference to a resource in Silverpeas.
-
-