com.silverpeas.form.record
Class GenericRecordTemplate

java.lang.Object
  extended by com.silverpeas.form.record.GenericRecordTemplate
All Implemented Interfaces:
RecordTemplate, Serializable

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
GenericRecordTemplate()
          A GenericRecordTemplate is built empty : use addFieldTemplate for each field.
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericRecordTemplate

public GenericRecordTemplate()
A GenericRecordTemplate is built empty : use addFieldTemplate for each field.

See Also:
addFieldTemplate
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 interface RecordTemplate

getFieldTemplates

public FieldTemplate[] getFieldTemplates()
Returns all the field templates.

Specified by:
getFieldTemplates in interface RecordTemplate

getFieldTemplate

public FieldTemplate getFieldTemplate(String fieldName)
                               throws FormException
Returns the FieldTemplate of the named field.

Specified by:
getFieldTemplate in interface RecordTemplate
Throws:
FormException

getFieldIndex

public int getFieldIndex(String fieldName)
                  throws FormException
Returns the field index of the named field.

Specified by:
getFieldIndex in interface RecordTemplate
Throws:
FormException

getEmptyRecord

public DataRecord getEmptyRecord()
                          throws FormException
Returns an empty DataRecord built on this template.

Specified by:
getEmptyRecord in interface RecordTemplate
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 interface RecordTemplate

setTemplateName

public void setTemplateName(String templateName)


Copyright © 2016 Silverpeas. All Rights Reserved.