Class GenericFieldTemplate

    • Constructor Detail

      • GenericFieldTemplate

        public GenericFieldTemplate()
        Builds a GenericFieldTemplate
      • GenericFieldTemplate

        public GenericFieldTemplate​(String fieldName,
                                    String typeName)
                             throws FormException
        Builds a GenericFieldTemplate from a field name and a field type name. The type name must be known by the type manager. You must use the set and add methods to change any default value.
        Throws:
        FormException
      • GenericFieldTemplate

        public GenericFieldTemplate​(String fieldName,
                                    Class<? extends Field> fieldImpl)
                             throws FormException
        Builds a GenericFieldTemplate from a field name and a field implementation. You must use the set and add methods to change any default value.
        Throws:
        FormException
    • Method Detail

      • getFieldName

        public String getFieldName()
        Returns the field name of the Field built on this template.
        Specified by:
        getFieldName in interface FieldTemplate
      • setFieldName

        public void setFieldName​(String fieldName)
        Set the field name of the Field built on this template.
      • getDisplayerName

        public String getDisplayerName()
        Returns the name of the FieldDisplayer to display the described field.
        Specified by:
        getDisplayerName in interface FieldTemplate
      • setDisplayerName

        public void setDisplayerName​(String displayerName)
        Set the name of the FieldDisplayer.
      • getLabel

        public String getLabel()
        Returns the default label of the described field.
        Specified by:
        getLabel in interface FieldTemplate
      • getParameter

        public String getParameter​(String name,
                                   String language)
        Returns a local parameter of the described field.
      • setLabel

        public void setLabel​(String label)
        Set the default label.
      • addLabel

        public void addLabel​(String label,
                             String language)
        Adds a local label.
      • addParameter

        public void addParameter​(String name,
                                 String value)
        Adds a local parameter.
      • isMandatory

        public boolean isMandatory()
        Returns true when the described field must have a value.
        Specified by:
        isMandatory in interface FieldTemplate
      • setMandatory

        public void setMandatory​(boolean isMandatory)
        Set or unset the isMandatory flag
      • setMandatory

        public void setMandatory​(Boolean isMandatory)
        Set or unset the isMandatory flag
      • isReadOnly

        public boolean isReadOnly()
        Returns true when the described field can't be updated.
        Specified by:
        isReadOnly in interface FieldTemplate
      • setReadOnly

        public void setReadOnly​(boolean isReadOnly)
        Set or unset the isReadOnly flag
      • isDisabled

        public boolean isDisabled()
        Returns true when the described field must be disabled.
        Specified by:
        isDisabled in interface FieldTemplate
      • setDisabled

        public void setDisabled​(boolean isDisabled)
        Set or unset the isDisabled flag
      • isHidden

        public boolean isHidden()
        Returns true when the described field must be hidden.
        Specified by:
        isHidden in interface FieldTemplate
      • setHidden

        public void setHidden​(boolean isHidden)
        Set or unset the isHidden flag
      • getParameters

        public Map<String,​String> getParameters​(String language)
        Description copied from interface: FieldTemplate
        Returns a Map (String -> String) of named parameters which can be used by the displayer (max-size, length ...).
        Specified by:
        getParameters in interface FieldTemplate
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getLabelsObj

        public List<Label> getLabelsObj()
        Used by the XML mapping.
      • setLabelsObj

        public void setLabelsObj​(List<Label> labelsObj)
        Used by the XML mapping.
      • setParametersObj

        public void setParametersObj​(List<Parameter> parametersObj)
        Used by the XML mapping.
      • setSearchable

        public void setSearchable​(boolean searchable)
      • setTemplateName

        public void setTemplateName​(String templateName)
      • setUsedAsFacet

        public void setUsedAsFacet​(boolean usedAsFacet)
      • setMaximumNumberOfOccurrences

        public void setMaximumNumberOfOccurrences​(int nb)