Class AbstractGomFormElement

java.lang.Object
de.espirit.firstspirit.access.store.templatestore.gom.AbstractGomElement
de.espirit.firstspirit.access.store.templatestore.gom.AbstractGomFormElement
All Implemented Interfaces:
GomCheckable, GomElement, GomFormElement, GomHideable, GomLangInfoProvider, GomSearchRelevancy, LineBreakable, Serializable

public abstract class AbstractGomFormElement extends AbstractGomElement implements GomFormElement, GomCheckable, LineBreakable, GomSearchRelevancy
Abstract class defining most common features of a form element.

For using an extended language information container when subclassing, the extended container must subclass DefaultGomLangInfos andoverride getLangInfos()!

Since:
4.0.17
See Also:
  • Constructor Details

    • AbstractGomFormElement

      public AbstractGomFormElement()
  • Method Details

    • getName

      public Designator getName()
      Provide the form element name following specific rules.
      Specified by:
      getName in interface GomFormElement
      Returns:
      A name designator.
      Since:
      4.0.17
    • setName

      public void setName(Designator name)
      Sets the form element name.
      Specified by:
      setName in interface GomFormElement
      Parameters:
      name - The name designator.
      Since:
      4.0.17
    • getConvertEntities

      public ConvertEntity getConvertEntities()
      Provides the mode for entity conversions.
      Returns:
      The entity conversion mode. Default is none.
      Since:
      4.0.17
    • setConvertEntities

      public void setConvertEntities(ConvertEntity convertEntities)
      Sets the mode for entity conversions.
      Parameters:
      convertEntities - The conversion mode.
      Since:
      4.0.17
    • getHFill

      public YesNo getHFill()
      Indicates, whether to horizontally fill a form by this form element.
      Returns:
      YES, if set to fill horizontally. Default is no.
      Since:
      4.0.17
    • setHFill

      public void setHFill(YesNo hfill)
      Sets, whether to horizontally fill a form by this form element.
      Parameters:
      hfill - YES, if order to fill horizontally.
      Since:
      4.0.17
    • getUseLanguages

      public YesNo getUseLanguages()
      Indicates, whether to have separate values in different languages.
      Returns:
      YES, if it has separate values. Default is YesNo.YES.
      Since:
      4.0.17
    • setUseLanguages

      public void setUseLanguages(YesNo useLanguages)
      Sets whether to use different values in each language or not.
      Parameters:
      useLanguages - YES, to allow for separate values.
      Since:
      4.0.17
    • getNoBreak

      public YesNo getNoBreak()
      Indicates, whether the next form element should follow in the same line as this one.
      Returns:
      YES, to make the next form element follow. Defaults to YesNo.NO.
      Since:
      4.0.17
    • setNoBreak

      public void setNoBreak(YesNo noBreak)
      Set whether the next form element should follow immediately in the same line as this one.
      Parameters:
      noBreak - YES, to make the next element follow in line.
      Since:
      4.0.17
    • getAllowEmpty

      public YesNo getAllowEmpty()
      Indicates, whether the form element allows to stay empty.
      Specified by:
      getAllowEmpty in interface GomFormElement
      Returns:
      YES, if empty is allowed. Defaults to YesNo.YES.
      Since:
      4.0.17
    • setAllowEmpty

      public void setAllowEmpty(YesNo allowEmpty)
      Sets whether empty is allowed for this form element.
      Specified by:
      setAllowEmpty in interface GomFormElement
      Parameters:
      allowEmpty - YES, if empty shall be allowed.
      Since:
      4.0.17
    • getHidden

      public YesNo getHidden()
      Indicates, whether this form element is visible in the form.
      Specified by:
      getHidden in interface GomFormElement
      Returns:
      YES, if hidden. Defaults to no.
      Since:
      4.0.44
    • setHidden

      public void setHidden(YesNo hidden)
      Sets the form element to be hidden or not.
      Specified by:
      setHidden in interface GomFormElement
      Parameters:
      hidden - YES, to hide the form element.
      Since:
      4.0.44
    • getPreset

      public Preset getPreset()
      Provides the mode for handling preset value for this form element.
      Specified by:
      getPreset in interface GomFormElement
      Returns:
      The preset mode. Defaults to default.
      Since:
      4.0.55
    • setPreset

      public void setPreset(Preset preset)
      Sets the preset mode to be used for default values.
      Specified by:
      setPreset in interface GomFormElement
      Parameters:
      preset - The preset mode.
      Since:
      4.0.55
    • getLangInfos

      public DefaultGomLangInfos getLangInfos()
      Provides language dependent information on this form element, like a label and description for multiple languages.
      Specified by:
      getLangInfos in interface GomLangInfoProvider
      Returns:
      A language information container.
      Since:
      4.0.17
    • getSearchRelevancy

      public Relevancy getSearchRelevancy()
      Provides the relevancy level of this GOM element's value wrt. indexing.
      Specified by:
      getSearchRelevancy in interface GomSearchRelevancy
      Returns:
      The relevancy level.
      Since:
      5.2.305
    • setSearchRelevancy

      public void setSearchRelevancy(@Nullable @Nullable Relevancy relevancy)
      Sets the relevancy level for this GOM element.
      Specified by:
      setSearchRelevancy in interface GomSearchRelevancy
      Parameters:
      relevancy - The relevancy level.
      Since:
      5.2.305
    • verify

      public void verify() throws IllegalStateException
      Verifies the form element's state. In this generic part, checks for the required name and language information.
      Specified by:
      verify in interface GomCheckable
      Throws:
      IllegalStateException - if any requirement is violated.
      Since:
      4.2.8
    • validate

      public void validate(GomCheckable.Context context) throws GomValidationError
      Validates the form element's state with respect to the given context. This generic stub does not check anything.
      Specified by:
      validate in interface GomCheckable
      Parameters:
      context - The context to validate for.
      Throws:
      GomValidationError - if any requirement is violated.
      Since:
      4.0.17
    • clone

      protected AbstractGomFormElement clone()
      Creates a clone of this form element.
      Overrides:
      clone in class Object
      Returns:
      A clone.
      Since:
      4.1.12
    • getDefaultValue

      public EditorValue<?> getDefaultValue()
      Provides the editor containing the default value for this form element.
      Specified by:
      getDefaultValue in interface GomFormElement
      Returns:
      The default value container.
      Since:
      4.0.17
    • setDefaultValue

      public void setDefaultValue(EditorValue<?> editorValue)
      Sets the editor providing the default value for this form element.
      Specified by:
      setDefaultValue in interface GomFormElement
      Parameters:
      editorValue - The default value provding container.
      Since:
      4.0.17
    • name

      @NotNull public @NotNull String name()
      Provides the textual name of this form element.
      Specified by:
      name in interface GomFormElement
      Returns:
      The element's name.
      Since:
      4.0.17
    • convertEntities

      public ConvertEntity convertEntities()
      Provides a non-null setting for entity conversion.
      Specified by:
      convertEntities in interface GomFormElement
      Returns:
      The entity conversion setting.
      Since:
      4.0.17
    • fillsHorizontally

      public boolean fillsHorizontally()
      Indicates whether to fill the form horizontally with this form element.
      Specified by:
      fillsHorizontally in interface GomFormElement
      Returns:
      true, if to fill horizontally.
      Since:
      4.0.17
    • usesLanguages

      public boolean usesLanguages()
      Indicates whether to use separate values in each language or not.
      Specified by:
      usesLanguages in interface GomFormElement
      Returns:
      true, if separate values are supported.
      Since:
      4.0.17
    • breaks

      public boolean breaks()
      Indicates, whether to break after this form element.
      Specified by:
      breaks in interface GomFormElement
      Specified by:
      breaks in interface LineBreakable
      Returns:
      true, if the next form element should follow in the next line.
      Since:
      4.0.17
    • allowsEmpty

      public boolean allowsEmpty()
      Indicates, whether empty values are allowed.
      Specified by:
      allowsEmpty in interface GomFormElement
      Returns:
      true, if empty values are allowed.
      Since:
      4.0.17
    • isHidden

      public boolean isHidden()
      Indicates, whether to hide this component from the form.
      Specified by:
      isHidden in interface GomHideable
      Returns:
      true, if hiding is requested.
      Since:
      4.0.44
    • preset

      public Preset preset()
      Provides the preset mode for this form element.
      Specified by:
      preset in interface GomFormElement
      Returns:
      The preset mode.
      Since:
      4.0.55
    • label

      public String label(String lang)
      Returns the forms name instead of a null label.
      Specified by:
      label in interface GomLangInfoProvider
      Parameters:
      lang - The language abbreviation.
      Returns:
      The label.
      Since:
      4.0.17
      See Also:
    • description

      public String description(String lang)
      Provides the description for this form element in the requested language.
      Specified by:
      description in interface GomLangInfoProvider
      Parameters:
      lang - The language abbreviation.
      Returns:
      The description.
      Since:
      4.0.17
    • setLabelAndDescription

      public final void setLabelAndDescription(@NotNull @NotNull String lang, @Nullable @Nullable String label, @Nullable @Nullable String description)
      Sets the label and description for a specific language.
      Parameters:
      lang - The language abbreviation.
      label - The label.
      description - The description.
      Since:
      4.0.17
    • getLabel

      @Deprecated public String getLabel()
      Deprecated.
      since 4.0.17 originally replaced by LangInfos-Tag, now for hiding in GOM and enable attribute to tag conversion.
      For GOM parsing only. Enables conversion to LangInfos-Tag. Always returns null.
      Since:
      4.0.17
    • setLabel

      @Deprecated public void setLabel(String label)
      Deprecated.
      since 4.0.17 originally replaced by LangInfos-Tag, now for hiding in GOM and enable attribute to tag conversion.
      For GOM parsing only. Enables conversion to LangInfos-Tag.
      Since:
      4.0.17