Package com.orchestranetworks.instance

# Interface ValueContextForValidationOnTable

public interface ValueContextForValidationOnTable
This interface provides the services for accessing the content of a table and for adding validation messages in the context of a validation process.

Those messages are then accessed as `validation report items` in the context of a validation report.

See Also:
  - `ConstraintOnTable.checkTable(ValueContextForValidationOnTable)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addMessage(Adaptation aRecord, UserMessage aMessage)`
  Adds the specified validation message concerning a single record.
  `void`
  `addMessage(Adaptation aRecord, SchemaNode aNode, UserMessage aMessage)`
  Adds the specified validation message concerning a node in a single record.
  `void`
  `addMessage(UserMessage aMessage)`
  This method creates a new `validation item` whose `subject` is the table that is currently being validated.
  `void`
  `addMessage(String xpathPredicateOfRecords, UserMessage aMessage)`
  Adds the specified validation message concerning the result of an XPath predicate.
  `void`
  `addMessage(List<Adaptation> records, UserMessage aMessage)`
  Adds the specified validation message concerning a set of records.
  `AdaptationHome`
  `getFunctionalDataspace()`
  Returns the dataspace that contains the table for which the validation has been requested.
  `AdaptationTable`
  `getTable()`
  Returns the table that is currently being validated.

- ## Method Details

  - ### getTable

    AdaptationTable getTable()
    Returns the table that is currently being validated.

    Method `getFunctionalDataspace()` can be used to retrieve the functional dataspace that contains the original table.

  - ### getFunctionalDataspace

    AdaptationHome getFunctionalDataspace()
    Returns the dataspace that contains the table for which the validation has been requested.
    Since:
      6.0.6

  - ### addMessage

    void addMessage(String xpathPredicateOfRecords, UserMessage aMessage)
    Adds the specified validation message concerning the result of an XPath predicate.

    The added message will be contained by the table that is currently being validated, (see `AdaptationTable.getValidationReport()`).

    Concretely, this method creates a new validation item whose subject is a `ValidationReportItemSubjectForTable`. The specified XPath can be accessed using the method `ValidationReportItemSubjectForTable.getXPathPredicateOfRecords()`.

    Parameters:
      `xpathPredicateOfRecords` - specifies the records with which the new validation item is associated. For a single record, the method `Adaptation.toXPathPredicateString()` can be invoked.
      `aMessage` - the validation message
    Throws:
      `IllegalArgumentException` - if the result of the XPath predicate is not consistent with the table node.

  - ### addMessage

    void addMessage(List<Adaptation> records, UserMessage aMessage)
    Adds the specified validation message concerning a set of records.

    This method is equivalent to `addMessage(String, UserMessage)`.

    Throws:
      `IllegalArgumentException` - if specified records are not consistent with the current context.

  - ### addMessage

    void addMessage(Adaptation aRecord, UserMessage aMessage)
    Adds the specified validation message concerning a single record.

    This method is equivalent to `addMessage(String, UserMessage)`.

    Throws:
      `IllegalArgumentException` - if the specified record is not consistent with the current context.
    See Also:
      - `addMessage(String, UserMessage)`

  - ### addMessage

    void addMessage(Adaptation aRecord, SchemaNode aNode, UserMessage aMessage)
    Adds the specified validation message concerning a node in a single record.
    Throws:
      `IllegalArgumentException` - if the specified node or record is not consistent with the current context.
    See Also:
      - `addMessage(String, UserMessage)`

  - ### addMessage

    void addMessage(UserMessage aMessage)

    This method creates a new `validation item` whose `subject` is the table that is currently being validated. The item is also contained by the same table, so that it can be accessed using the method `AdaptationTable.getValidationReport(boolean)`.

    When displaying the message, EBX® usually adds information about the subject (for example, the validation report in EBX® user interface displays the subject as a hyperlink). Consequently, it is not required to repeat this contextual information in the message argument.

    See Also:
      - `ValidationReportItem`
      - `ValidationReportItemSubjectForAdaptation`