Interface RecordTemplate
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DummyRecordTemplate
,GenericRecordTemplate
,IdentifiedRecordTemplate
,ProcessInstanceRecordTemplate
,ProcessInstanceRowTemplate
,ProcessInstanceTemplate
public interface RecordTemplate extends Serializable
A RecordTemplate defines the schema of aDataRecord
by defining the fields by their names and types.- See Also:
DataRecord
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
checkDataRecord(DataRecord record)
Checks the specifiedDataRecord
instance matches this template.DataRecord
getEmptyRecord()
Gets an empty DataRecord built on this template.int
getFieldIndex(String fieldName)
Gets the index in this template of of the named field.String[]
getFieldNames()
Gets all the field names of theDataRecord
s built on this template.FieldTemplate
getFieldTemplate(String fieldName)
Gets theFieldTemplate
modelling the specified named field.FieldTemplate[]
getFieldTemplates()
Gets all the fields defined by this template.
-
-
-
Method Detail
-
getFieldNames
String[] getFieldNames()
Gets all the field names of theDataRecord
s built on this template.- Returns:
- an array with the name of the fields defined by this template.
-
getFieldTemplates
FieldTemplate[] getFieldTemplates() throws FormException
Gets all the fields defined by this template.- Returns:
- an array of
FieldTemplate
instances, each of them being a template of aDataRecord
field. - Throws:
FormException
- is an error occurs while getting the template of the fields.
-
getFieldTemplate
FieldTemplate getFieldTemplate(String fieldName) throws FormException
Gets theFieldTemplate
modelling the specified named field.- Parameters:
fieldName
- the name of a field- Returns:
- a
FieldTemplate
instance or null if there is no such template. - Throws:
FormException
- if the template of the specified named field cannot be got.- API Note:
- the
FormException
can be thrown if the template of the named field cannot be found instead of returning null. It depends of the implementation of the concrete class.
-
getFieldIndex
int getFieldIndex(String fieldName) throws FormException
Gets the index in this template of of the named field.- Parameters:
fieldName
- the name of a field.- Returns:
- the index of the named field in this template or -1 if no template of this field can be found.
- Throws:
FormException
- if the template of the specified named field cannot be got.- API Note:
- the
FormException
can be thrown if the template of the named field cannot be found instead of returning -1. It depends of the implementation of the concrete class.
-
getEmptyRecord
DataRecord getEmptyRecord() throws FormException
Gets an empty DataRecord built on this template.- Returns:
- an empty
DataRecord
instance. - Throws:
FormException
-
checkDataRecord
boolean checkDataRecord(DataRecord record)
Checks the specifiedDataRecord
instance matches this template.- Parameters:
record
- aDataRecord
object.- Returns:
- true if the data record is built on this template and all the constraints are satisfied.
-
-