org.eclipse.viatra.addon.validation.core.api

## Interface IConstraintSpecification

- All Known Implementing Classes:
    ConstraintSpecification

      public interface IConstraintSpecification

  Interface for a constraint specification.

  A constraint specification represents a well-formedness or structural validation rule that is specified with concepts from metamodels and can be evaluated over instance models. E.g. a constraint specification is "A terminated data port cannot be the end of a port connection", where "terminated", "data port", "port connection" and "connection end" are concepts in the metamodel.

  The constraint specification contains:

  - the converting mechanism for creating the key information for a violation
  - the format message that is used to create the message of a violation
  - the severity level (e.g. error, warning)

  When constraint specifications are represented by VIATRA Query patterns, the corresponding query specification is stored.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.List<java.lang.String>` | `getKeyNames()` Returns the key parameter names of the constraint specification.
    `java.util.Map<java.lang.String,java.lang.Object>` | `getKeyObjects(IPatternMatch signature)` Returns the key objects (parameter names with the corresponding EObject objects) of a violation for the given pattern match.
    `java.lang.String` | `getMessageFormat()` Returns the format message of the constraint specification to compose the corresponding message for a particular violation of the constraint.
    `java.util.List<java.lang.String>` | `getPropertyNames()` Returns the property parameter names of the constraint specification.
    `IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>` | `getQuerySpecification()` Returns the VIATRA Query-specific query specification of the constraint specification.
    `Severity` | `getSeverity()` Returns the severity of the violations corresponding to the constraint specified by the constraint specification.
    `java.util.Set<java.util.List<java.lang.String>>` | `getSymmetricKeyNames()` Returns the lists of symmetric key parameter names, where the permutation of the same objects for the parameters count as the same key, thus the same violation.
    `java.util.Set<java.util.List<java.lang.String>>` | `getSymmetricPropertyNames()` Returns the lists symmetric parameter names, where the permutation of the same objects for the parameters count as the same match.

- - ### Method Detail

    - #### getMessageFormat

          java.lang.String getMessageFormat()

      Returns the format message of the constraint specification to compose the corresponding message for a particular violation of the constraint.
      Returns:
        The format message.

    - #### getKeyObjects

          java.util.Map<java.lang.String,java.lang.Object> getKeyObjects(IPatternMatch signature)

      Returns the key objects (parameter names with the corresponding EObject objects) of a violation for the given pattern match.
      Parameters:
        `signature` - The pattern match for which the key objects should be retrieved.
      Returns:
        A Map with the key parameter name and value pairs.

    - #### getKeyNames

          java.util.List<java.lang.String> getKeyNames()

      Returns the key parameter names of the constraint specification.
      Returns:
        A List of the key parameter names.

    - #### getPropertyNames

          java.util.List<java.lang.String> getPropertyNames()

      Returns the property parameter names of the constraint specification.
      Returns:
        A List of the property parameter names.

    - #### getSeverity

          Severity getSeverity()

      Returns the severity of the violations corresponding to the constraint specified by the constraint specification.
      Returns:
        The severity.

    - #### getSymmetricPropertyNames

          java.util.Set<java.util.List<java.lang.String>> getSymmetricPropertyNames()

      Returns the lists symmetric parameter names, where the permutation of the same objects for the parameters count as the same match.
      Returns:
        The Set of a symmetric parameter names lists.

    - #### getSymmetricKeyNames

          java.util.Set<java.util.List<java.lang.String>> getSymmetricKeyNames()

      Returns the lists of symmetric key parameter names, where the permutation of the same objects for the parameters count as the same key, thus the same violation.
      Returns:
        The Set of a symmetric key parameter names lists.

    - #### getQuerySpecification

          IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> getQuerySpecification()

      Returns the VIATRA Query-specific query specification of the constraint specification.
      Returns:
        The query specification.