Interface ValidationContext<VIEWT>

Type Parameters:
VIEWT - Type of the subtree or the value that is being validated.

public interface ValidationContext<VIEWT>
Validation context for the validators.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Signifies that there's something wrong.
    Returns the key of validated node.
    <T> T
    Returns the updated view of the owner of the current value.
    <ROOT> ROOT
    getNewRoot(RootKey<?,ROOT,?> rootKey)
    Returns updated value of the configuration root.
    Returns updated value of the configuration.
    <T> T
    Returns a previous view of the owner of the current value.
    <ROOT> ROOT
    getOldRoot(RootKey<?,ROOT,?> rootKey)
    Returns previous value of the configuration root.
    Returns previous value of the configuration.
  • Method Details

    • currentKey

      String currentKey()
      Returns the key of validated node.
      Returns:
      String representation of currently validated value, i.e. root.config.node.
    • getOldValue

      @Nullable VIEWT getOldValue()
      Returns previous value of the configuration.
      Returns:
      Previous value of the configuration. Might be null for leaves only.
    • getNewValue

      VIEWT getNewValue()
      Returns updated value of the configuration.
      Returns:
      Updated value of the configuration. Cannot be null.
    • getOldRoot

      @Nullable <ROOT> ROOT getOldRoot(RootKey<?,ROOT,?> rootKey)
      Returns previous value of the configuration root.
      Type Parameters:
      ROOT - Root view type derived from the root key.
      Parameters:
      rootKey - Root key.
    • getNewRoot

      @Nullable <ROOT> ROOT getNewRoot(RootKey<?,ROOT,?> rootKey)
      Returns updated value of the configuration root.
      Type Parameters:
      ROOT - Root view type derived from the root key.
      Parameters:
      rootKey - Root key.
    • addIssue

      void addIssue(ValidationIssue issue)
      Signifies that there's something wrong. Values will be accumulated and passed to the user later.
      Parameters:
      issue - Validation issue object.
      See Also:
    • getOldOwner

      @Nullable <T> T getOldOwner()
      Returns a previous view of the owner of the current value.

      For primitives/nested configuration/named list, the owner is the configuration in which they are declared, for example TableView will be returned for the string field, null will be returned for the root configuration.

      Type Parameters:
      T - Owner view type.
    • getNewOwner

      @Nullable <T> T getNewOwner()
      Returns the updated view of the owner of the current value.

      For primitives/nested configuration/named list, the owner is the configuration in which they are declared, for example TableView will be returned for the string field, null will be returned for the root configuration.

      Type Parameters:
      T - Owner view type.