Interface Attribute<T>

All Superinterfaces:
Serializable
All Known Subinterfaces:
ComposedAttribute<T>, SimpleAttribute<T>

public interface Attribute<T> extends Serializable
This is the interface for all implementations of attributes which can defined by an entity type.
Since:
4.0.17
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the display text of this attribute.
    Return the name of this attribute.
    Return the entity type which defines this attribute.
    Return the type of this attribute.
    Return the validator of this attribute.
    boolean
    Return true if this attribute is a key attribute else false.
    boolean
    A read only attribute can not be set by the client.
    boolean
    Return true if this attribute is a required attribute.
    boolean
    isValid(T value)
    Check if value can be assigned to this attribute by using the assigned validator setValidator(de.espirit.or.schema.Validator<T>).
    boolean
    Return true if this attribute is visible in the schema editor.
    void
    Set the name of this attribute to name.
    void
    setReadOnly(boolean readOnly)
    Set the read only property of this attribute to readOnly.
    void
    setRequired(boolean flag)
    Set the required property of this attribute to flag.
    void
    setValidator(Validator<T> validator)
    Set the validator of this attribute to validator.
  • Method Details

    • getName

      String getName()
      Return the name of this attribute.
      Since:
      4.0.17
    • setName

      void setName(String name)
      Set the name of this attribute to name.
      Since:
      4.0.17
    • getDisplayText

      String getDisplayText()
      Return the display text of this attribute. This method is used by the UI.
      Since:
      4.0.17
    • getType

      Class<T> getType()
      Return the type of this attribute.
      • If the attribute is a simple attribute then the type is the java class of the value which can be assigned to this attribute.
      • by a composed attribute then type is the EntityType
      Since:
      4.0.17
    • isRequired

      boolean isRequired()
      Return true if this attribute is a required attribute.
      Since:
      4.0.17
    • setRequired

      void setRequired(boolean flag)
      Set the required property of this attribute to flag.
      Since:
      4.0.17
    • getValidator

      Validator<T> getValidator()
      Return the validator of this attribute.
      Since:
      4.0.17
    • setValidator

      void setValidator(Validator<T> validator)
      Set the validator of this attribute to validator.
      Parameters:
      validator -
      Since:
      4.0.17
    • isValid

      boolean isValid(@Nullable T value)
      Check if value can be assigned to this attribute by using the assigned validator setValidator(de.espirit.or.schema.Validator<T>).
      Since:
      4.0.17
    • isReadOnly

      boolean isReadOnly()
      A read only attribute can not be set by the client. Its value is generated by the ORMapper.
      Since:
      4.0.17
    • setReadOnly

      void setReadOnly(boolean readOnly)
      Set the read only property of this attribute to readOnly. Default value for this property is false.
      Since:
      4.0.17
    • getOwner

      EntityType getOwner()
      Return the entity type which defines this attribute.
      Since:
      4.0.17
    • isKey

      boolean isKey()
      Return true if this attribute is a key attribute else false.
      Since:
      4.0.17
    • isVisible

      boolean isVisible()
      Return true if this attribute is visible in the schema editor.
      Since:
      4.0.17