Interface FieldModel

All Superinterfaces:
ModelElement, ModuleTracker
All Known Implementing Classes:
DefaultFieldModel, FieldModelImpl

public interface FieldModel extends ModelElement, ModuleTracker
The model of one Entity Model's field.

The backendData is of type FieldModelInfo.

  • Method Details

    • getName

      String getName()
      Returns the entity field name; the name attribute of the field tag in xml.
    • getTarget

      String getTarget()
      Returns the internal field name, eg db table field name; the target attribute of the field tag in xml.
    • isNullable

      boolean isNullable()
      Tells if the field accepts the null value to be stored in it. Key fields are never nullable.
    • isUnique

      boolean isUnique()
      Tells if the field's values are unique (i.e. a value may only exists once)
      Returns:
      true if the field's values are unique
    • isKey

      boolean isKey()
      Tells if this field is the or part of the primary key.

      It has nothing to do with indexed fields, nor with foreign keys.

    • isVirtual

      boolean isVirtual()
    • isSynthetic

      boolean isSynthetic()
    • getType

      Type<?> getType()
      Returns:
      Returns the nice Type object which for example represents a string.
    • getDefaultValue

      Object getDefaultValue()
      Returns the DefaultValueDescriptor. This is the dynamic default value that can be defined on the entity as well as on the form.

      The reason that this signature returns 'Object' is because the interface cannot be seen.

      Returns:
      instance of DefaultValueDescriptor
    • setNullable

      void setNullable(boolean nullable)
      Parameters:
      nullable - true/false
      Throws:
      IllegalStateException - when trying to set this value after reading the mode.
      See Also:
    • setUnique

      void setUnique(boolean unique)
      Parameters:
      unique - true/false
    • setVirtual

      void setVirtual(boolean virtual)
    • setSynthetic

      void setSynthetic(boolean synthetic)
    • setName

      void setName(String name)
      Parameters:
      name - the name, non-null
      Throws:
      IllegalStateException - when trying to set this value after reading the mode.
      See Also:
    • setTarget

      void setTarget(String target)
      Parameters:
      target - the target
      Throws:
      IllegalStateException - when trying to set this value after reading the mode.
      See Also:
    • setType

      void setType(Type type)
      Parameters:
      type - the type
      Throws:
      IllegalStateException - when trying to set this value after reading the mode.
      See Also:
    • setDefaultValue

      void setDefaultValue(Object descriptor)
    • hasNonEmptyValidator

      boolean hasNonEmptyValidator()
      Returns:
      Tells if this field model has a validator, a GroupValidator to be precise, which has at least one entry.
      See Also:
    • getValidator

      GroupValidator getValidator()
      Returns:
      Returns the outermost group validator which may be empty.
      See Also:
    • setValidator

      void setValidator(AndGroupValidator validator)
      Sets the primary validator which may contain real validation validators and other groups.

      Method for the startup process.

      Parameters:
      validator - The group validator.
    • getLabel

      @Nullable @Nullable DisplayValue getLabel()
      Returns:
      The label of this field.
    • setLabel

      void setLabel(DisplayValue display)
      Parameters:
      display - the display, non-null
      Throws:
      IllegalStateException - when trying to set this value after reading the mode.
      See Also:
    • getDocumentation

      LinkedHashMap<String,String> getDocumentation()
      Returns the content of the documentation element of the FieldModel tag as a LinkedHashMap, divided by the AppModules extending the base FieldModel and contributing the documentation. The contents of the map are ordered according to the loading sequence of the AppModules.
      Returns:
      The LinkedHashMap containg the FieldModel's documentation tag.
    • addDocumentation

      void addDocumentation(String definingModule, String documentation)
      Adds documentation for the FieldModel, contributed by the defining AppModule.
      Parameters:
      definingModule - the string representation of the AppModule contributing the documentation
      documentation - the documentation for the FieldModel
    • setLocalized

      void setLocalized(boolean flag)
      Parameters:
      flag - true to make it a multilingual field, false to not.
    • isLocalized

      boolean isLocalized()
      Tells if this field is multilingual. If it is then this field model most likely has siblings; for every system language there is such a field model for the same field.
      See Also:
    • setXssFilter

      void setXssFilter(boolean xssFilter)
    • isXssFilter

      boolean isXssFilter()
    • setBaseField

      void setBaseField(FieldModel baseField)
      Set the base field for synthetic localized fields.
    • getBaseField

      Optional<FieldModel> getBaseField()
      Get the base field of a localized field. If the field we're currently working on is localized and getBaseField() doesn't return a field, then it might already be the base field.
      Returns:
      the base field of the localized field.
      See Also:
    • isMandatory

      boolean isMandatory()
      Returns:
      true if a MandatoryValidator is registered for the underlying field and thus the field is mandatory
    • isBinaryReplacementDisabled

      boolean isBinaryReplacementDisabled()
      When a binary field is changed, a dialog is shown to the user to update all other binary fields which contain the same binary data. If this boolean flag ist set to `true`, the dialog won't show up if this field is changed. The default value for this flag is `false`.
    • setBinaryReplacementDisabled

      void setBinaryReplacementDisabled(boolean disabled)
    • isPrivilegedAccessOnly

      boolean isPrivilegedAccessOnly()
    • setPrivilegedAccessOnly

      void setPrivilegedAccessOnly(boolean privilegedAccessOnly)