Class ArtifactMatchExpression
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.expressions.Expression
-
- net.ssehub.easy.instantiation.core.model.buildlangModel.ruleMatch.AbstractRuleMatchExpression
-
- net.ssehub.easy.instantiation.core.model.buildlangModel.ruleMatch.ArtifactMatchExpression
-
public class ArtifactMatchExpression extends AbstractRuleMatchExpression
Implements an artifact match expression.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private Expressionexpressionprivate java.lang.Objectresolved
-
Constructor Summary
Constructors Constructor Description ArtifactMatchExpression(Expression expression)Creates a new collection match expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Objectaccept(IMatchVisitor visitor)Accepts the given visitor for visiting.booleancontributesTo(AbstractRuleMatchExpression expression)Returns whether this rule match expression may contribute to the fulfillment ofexpression.java.lang.ObjectdetermineExpected(AbstractRuleMatchExpression rhsExpr, java.lang.Object rhsValue)Determines the expected value on the left side (represented by this object) based on the actual value for the corresponding right side.Collection<?>evaluate(IExpressionVisitor evaluator)Evaluates this expression.TypeDescriptor<?>getEntryType()Returns the entry type over which this match expression will be able to iterate.ExpressiongetExpression()Returns the artifact expression.(package private) voidresolve(java.lang.Object resolved)Resolves the expression.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.buildlangModel.ruleMatch.AbstractRuleMatchExpression
accept, ensureType, inferType
-
Methods inherited from class net.ssehub.easy.instantiation.core.model.expressions.Expression
getFormattingHint, replaceEmptyLine
-
-
-
-
Field Detail
-
expression
private Expression expression
-
resolved
private transient java.lang.Object resolved
-
-
Constructor Detail
-
ArtifactMatchExpression
public ArtifactMatchExpression(Expression expression) throws VilException
Creates a new collection match expression.- Parameters:
expression- an expression which evaluates to a collection- Throws:
VilException- in case that the expression does not evaluate to a collection
-
-
Method Detail
-
getExpression
public Expression getExpression()
Returns the artifact expression.- Returns:
- the artifact expression
-
getEntryType
public TypeDescriptor<?> getEntryType()
Description copied from class:AbstractRuleMatchExpressionReturns the entry type over which this match expression will be able to iterate.- Specified by:
getEntryTypein classAbstractRuleMatchExpression- Returns:
- the entry type
-
determineExpected
public java.lang.Object determineExpected(AbstractRuleMatchExpression rhsExpr, java.lang.Object rhsValue)
Description copied from class:AbstractRuleMatchExpressionDetermines the expected value on the left side (represented by this object) based on the actual value for the corresponding right side.- Specified by:
determineExpectedin classAbstractRuleMatchExpression- Parameters:
rhsExpr- the (resolved) RHS expressionrhsValue- the RHS value- Returns:
- the expected LHS value (null denotes no expectation)
-
accept
protected java.lang.Object accept(IMatchVisitor visitor) throws VilException
Description copied from class:AbstractRuleMatchExpressionAccepts the given visitor for visiting.- Specified by:
acceptin classAbstractRuleMatchExpression- Parameters:
visitor- the match visitor used for visiting- Returns:
- the result of visiting (may be null)
- Throws:
VilException- in case of visiting / evaluation errors
-
contributesTo
public boolean contributesTo(AbstractRuleMatchExpression expression)
Description copied from class:AbstractRuleMatchExpressionReturns whether this rule match expression may contribute to the fulfillment ofexpression.- Specified by:
contributesToin classAbstractRuleMatchExpression- Parameters:
expression- the expression to be considered (typically a RHS expression, while this is a LHS expression)- Returns:
trueif this rule may contribute,falseelse
-
evaluate
public Collection<?> evaluate(IExpressionVisitor evaluator) throws VilException
Description copied from class:AbstractRuleMatchExpressionEvaluates this expression. Some subtypes may define some kind of value resolution, e.g., for match expressions. This must be called before!- Specified by:
evaluatein classAbstractRuleMatchExpression- Parameters:
evaluator- the expression evaluator (in case that an actual expression must be evaluated as part of this evaluation).- Returns:
- the evaluation result
- Throws:
VilException- in case that evaluation fails
-
resolve
void resolve(java.lang.Object resolved)
Resolves the expression.- Parameters:
resolved- the resolved object
-
-