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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceMaps a variable to another while copying. -
Method Summary
Modifier and TypeMethodDescriptionCopies this version restriction for the givenmodel.Copies this version restriction for the given using the givenmapper.voidEmits the version restriction in terms of it's specification representation.booleanevaluate(IRestrictionEvaluationContext context, Version version) Evaluates the restriction.Turns the version restriction into it's specification representation.
-
Method Details
-
emit
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:
trueif the version matches the restriction,falseelse- Throws:
RestrictionEvaluationException- in case of evaluation problems
-
copy
Copies this version restriction for the givenmodel.- 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
IVersionRestriction copy(IVersionRestriction.IVariableMapper mapper) throws RestrictionEvaluationException Copies this version restriction for the given using the givenmapper.- 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
-