Package org.silverpeas.processmanager.record

## Class QuestionTemplate

- java.lang.Object
- - org.silverpeas.processmanager.record.QuestionTemplate

- All Implemented Interfaces:
    `Serializable`, `org.silverpeas.core.contribution.content.form.RecordTemplate`

      public class QuestionTemplate
      extends Object
      implements org.silverpeas.core.contribution.content.form.RecordTemplate

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `QuestionTemplate​(String language, boolean readonly)` | A QuestionTemplate is built from a language.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `checkDataRecord​(org.silverpeas.core.contribution.content.form.DataRecord record)` | Returns true if the data record is built on this template and all the constraints are ok.
    `org.silverpeas.core.contribution.content.form.DataRecord` | `getEmptyRecord()` | Returns an empty DataRecord built on this template.
    `int` | `getFieldIndex​(String fieldName)` | Returns the field index of the named field.
    `String[]` | `getFieldNames()` | Returns all the field names of the UserRecord built on this template.
    `org.silverpeas.core.contribution.content.form.FieldTemplate` | `getFieldTemplate​(String fieldName)` | Returns the FieldTemplate of the named field.
    `org.silverpeas.core.contribution.content.form.FieldTemplate[]` | `getFieldTemplates()` | Returns all the field templates.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### QuestionTemplate

          public QuestionTemplate​(String language,
                                  boolean readonly)

      A QuestionTemplate is built from a language.
      Parameters:
        `language` - the language
        `readonly` - is read only

  - ### Method Detail

    - #### getFieldNames

          public String[] getFieldNames()

      Returns all the field names of the UserRecord built on this template.
      Specified by:
        `getFieldNames` in interface `org.silverpeas.core.contribution.content.form.RecordTemplate`

    - #### getFieldTemplates

          public org.silverpeas.core.contribution.content.form.FieldTemplate[] getFieldTemplates()

      Returns all the field templates.
      Specified by:
        `getFieldTemplates` in interface `org.silverpeas.core.contribution.content.form.RecordTemplate`

    - #### getFieldTemplate

          public org.silverpeas.core.contribution.content.form.FieldTemplate getFieldTemplate​(String fieldName)
                                                                                       throws org.silverpeas.core.contribution.content.form.FormException

      Returns the FieldTemplate of the named field.
      Specified by:
        `getFieldTemplate` in interface `org.silverpeas.core.contribution.content.form.RecordTemplate`
      Throws:
        `org.silverpeas.core.contribution.content.form.FormException` - if the field name is unknown.

    - #### getFieldIndex

          public int getFieldIndex​(String fieldName)
                            throws org.silverpeas.core.contribution.content.form.FormException

      Returns the field index of the named field.
      Specified by:
        `getFieldIndex` in interface `org.silverpeas.core.contribution.content.form.RecordTemplate`
      Throws:
        `org.silverpeas.core.contribution.content.form.FormException` - if the field name is unknown.

    - #### getEmptyRecord

          public org.silverpeas.core.contribution.content.form.DataRecord getEmptyRecord()
                                                                                  throws org.silverpeas.core.contribution.content.form.FormException

      Returns an empty DataRecord built on this template.
      Specified by:
        `getEmptyRecord` in interface `org.silverpeas.core.contribution.content.form.RecordTemplate`
      Throws:
        `org.silverpeas.core.contribution.content.form.FormException`

    - #### checkDataRecord

          public boolean checkDataRecord​(org.silverpeas.core.contribution.content.form.DataRecord record)

      Returns true if the data record is built on this template and all the constraints are ok.
      Specified by:
        `checkDataRecord` in interface `org.silverpeas.core.contribution.content.form.RecordTemplate`