Interface IProperty

All Superinterfaces:
IAttributeConfigurable<IProperty>, Serializable

public interface IProperty extends IAttributeConfigurable<IProperty>, Serializable
Describes a property that is part of a value. For example, a record value consists of key-value pairs, each pair is a property.
Since:
7.0.0
Author:
XIMA MEDIA GmbH
  • Method Details

    • getAttributes

      Map<String,Object> getAttributes()
      List of attributes for this property. May be empty, but never null.
      Specified by:
      getAttributes in interface IAttributeConfigurable<IProperty>
      Returns:
      A map of attributes.
    • getBaseType

      EValueType getBaseType()
      Returns:
      Base type of this property's value.
    • getDefaultValue

      Object getDefaultValue()
      Returns:
      Default value for this property when no explicit value is provided.
    • getDescriptionI18n

      @Deprecated String getDescriptionI18n()
      Returns:
      Description for the property.
    • getDisplayDescription

      String getDisplayDescription(Locale locale, IMessageLocalizer localizer, String i18nPrefix)
      Gets the localized display description for this property, localized to the given locale. Returns a default if no description is set.
      Parameters:
      locale - The locale to localize to.
      localizer - The message localizer to use.
      i18nPrefix - The i18n prefix to prepend to i18n keys.
      Returns:
      The localized display description.
    • getDisplayDescriptionOptional

      String getDisplayDescriptionOptional(Locale locale, IMessageLocalizer localizer, String i18nPrefix)
      Gets the localized display description for this property, localized to the given locale.
      Parameters:
      locale - The locale to localize to.
      localizer - The message localizer to use.
      i18nPrefix - The i18n prefix to prepend to i18n keys.
      Returns:
      The localized display description, or empty if no description is set.
    • getDisplayLabel

      String getDisplayLabel(Locale locale, IMessageLocalizer localizer, String i18nPrefix)
      Gets the localized display label for this property, localized to the given locale. Returns a default when no label is set.
      Parameters:
      locale - The locale to localize to.
      localizer - The message localizer to use.
      i18nPrefix - The i18n prefix to prepend to i18n keys.
      Returns:
      The localized display label.
    • getDisplayLabelOptional

      String getDisplayLabelOptional(Locale locale, IMessageLocalizer localizer, String i18nPrefix)
      Gets the localized display label for this property, localized to the given locale.
      Parameters:
      locale - The locale to localize to.
      localizer - The message localizer to use.
      i18nPrefix - The i18n prefix to prepend to i18n keys.
      Returns:
      The localized display label, or empty if no label is set.
    • getDisplayPath

      String getDisplayPath()
      Gets a simple path descriptor for this property, starting at the root value. This is similar to the JSON path, but with a more user-friendly syntax. Array indices are represented as [i], map keys as ['key'].

      For programmatic access, use getJsonPath().

      Example: If the JSON path to access all elements is $.headers.*.*, the display path is .headers['key'][i].

      Returns:
      The display path for this property.
    • getFullType

      String getFullType()
      Returns:
      Full type of this property's value.
    • getJsonPath

      String getJsonPath()
      Gets the JSON path to access this property, starting at the root value, e.g. $.orientation[1].
      Returns:
      JSON path to access this property, starting at the root value.
    • getLogicalDisplayPath

      String getLogicalDisplayPath()
    • getNestingLevel

      int getNestingLevel()
      Returns:
      The nesting level of this property relative to the root value.
    • isOptional

      boolean isOptional()
      Returns:
      Whether this property must be present in the parent property. For example, a property of a record may be optional.
    • isUnionMember

      boolean isUnionMember()
      Whether this property is a member of a union type (i.e., its parent type is EValueType.UNION).
      Returns:
      True if this property is a member of a union type, false otherwise.
    • optional

      IProperty optional()
      Returns:
      A new property instance marked as optional
    • withDefaultDescription

      @Deprecated default IProperty withDefaultDescription(String description)
      Parameters:
      description - New description for this property, may be either a localized message or an I18N key.
      Returns:
      A new property instance with the given description.
    • withLogicalDisplayPath

      IProperty withLogicalDisplayPath(String newPath)
      Changes the display path of this property. Returns a new property instance with the changed display path.
      Parameters:
      newPath - New display path for this property.
      Returns:
      A new property instance with the given display path.
    • withUnionMember

      IProperty withUnionMember(boolean unionMember)
      Changes whether this property is a member of a union type. Returns a new property instance with the changed value.
      Parameters:
      unionMember - New value for whether this property is a member of a union type.
      Returns:
      A new property instance with the given value.