Interface IVersionRestriction


public interface IVersionRestriction
Denotes a version restriction. This abstraction is needed as individual languages may implement the restrictions differently, e.g., using (different versions of) constraints, evaluation mechanisms or simplified version restriction expressions.
Author:
Holger Eichelberger
  • Method Details

    • emit

      void emit(Object context)
      Emits the version restriction in terms of it's specification representation.
      Parameters:
      context - the output context (interpreted by the respective implementation, e.g., an output visitor in order to continue with the actual indentation, may be null but then nothing is emitted)
    • toSpecification

      String toSpecification()
      Turns the version restriction into it's specification representation.
      Returns:
      the specification representation
    • evaluate

      boolean evaluate(IRestrictionEvaluationContext context, Version version) throws RestrictionEvaluationException
      Evaluates the restriction.
      Parameters:
      context - the output context (interpreted by the respective implementation, e.g., an output visitor in order to continue with the actual indentation, may be null but then false will always be the result)
      version - the version (of the project) to be used for evaluation
      Returns:
      true if the version matches the restriction, false else
      Throws:
      RestrictionEvaluationException - in case of evaluation problems
    • copy

      Copies this version restriction for the given model.
      Parameters:
      model - the model to copy/instantiate this version restriction for
      Returns:
      the copied version restriction (may be null if no restrictions needed to be copied)
      Throws:
      RestrictionEvaluationException - in case of evaluation/type problems
    • copy

      Copies this version restriction for the given using the given mapper.
      Parameters:
      mapper - the variable mapper
      Returns:
      the copied version restriction (may be null if no restrictions needed to be copied)
      Throws:
      RestrictionEvaluationException - in case of evaluation/type problems