Class GenericRecordTemplate
- java.lang.Object
-
- org.silverpeas.core.contribution.content.form.record.GenericRecordTemplate
-
- All Implemented Interfaces:
Serializable
,RecordTemplate
public class GenericRecordTemplate extends Object implements RecordTemplate, Serializable
A GenericRecordTemplate builds GenericDataRecord. It use a map : Map (FieldName -> (index,GenericFieldTemplate))- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GenericRecordTemplate()
A GenericRecordTemplate is built empty : use addFieldTemplate for each field.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFieldTemplate(FieldTemplate fieldTemplate)
Adds a new field template at the end of this record template.boolean
checkDataRecord(DataRecord record)
Returns true if the data record is built on this template and all the constraints are ok.DataRecord
getEmptyRecord()
Returns an empty DataRecord built on this template.int
getFieldIndex(String fieldName)
Returns the field index of the named field.List<FieldTemplate>
getFieldList()
String[]
getFieldNames()
Returns all the field names of the DataRecord built on this template.FieldTemplate
getFieldTemplate(String fieldName)
Returns the FieldTemplate of the named field.FieldTemplate[]
getFieldTemplates()
Returns all the field templates.void
setFieldList(List<FieldTemplate> fieldList)
void
setTemplateName(String templateName)
-
-
-
Method Detail
-
getFieldList
public List<FieldTemplate> getFieldList()
-
setFieldList
public void setFieldList(List<FieldTemplate> fieldList)
-
addFieldTemplate
public void addFieldTemplate(FieldTemplate fieldTemplate)
Adds a new field template at the end of this record template.
-
getFieldNames
public String[] getFieldNames()
Returns all the field names of the DataRecord built on this template.- Specified by:
getFieldNames
in interfaceRecordTemplate
-
getFieldTemplates
public FieldTemplate[] getFieldTemplates()
Returns all the field templates.- Specified by:
getFieldTemplates
in interfaceRecordTemplate
-
getFieldTemplate
public FieldTemplate getFieldTemplate(String fieldName) throws FormException
Returns the FieldTemplate of the named field.- Specified by:
getFieldTemplate
in interfaceRecordTemplate
- Throws:
FormException
- if the field name is unknown.
-
getFieldIndex
public int getFieldIndex(String fieldName) throws FormException
Returns the field index of the named field.- Specified by:
getFieldIndex
in interfaceRecordTemplate
- Throws:
FormException
- if the field name is unknown.
-
getEmptyRecord
public DataRecord getEmptyRecord() throws FormException
Returns an empty DataRecord built on this template.- Specified by:
getEmptyRecord
in interfaceRecordTemplate
- Throws:
FormException
-
checkDataRecord
public boolean checkDataRecord(DataRecord record)
Returns true if the data record is built on this template and all the constraints are ok.- Specified by:
checkDataRecord
in interfaceRecordTemplate
-
setTemplateName
public void setTemplateName(String templateName)
-
-