Class StrategyCallExpression
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.expressions.Expression
-
- net.ssehub.easy.instantiation.core.model.expressions.AbstractCallExpression
-
- net.ssehub.easy.instantiation.core.model.expressions.CallExpression
-
- net.ssehub.easy.instantiation.core.model.buildlangModel.StrategyCallExpression
-
- All Implemented Interfaces:
IArgumentProvider
public class StrategyCallExpression extends CallExpression
Implements a strategy call.- Author:
- Holger Eichelberger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStrategyCallExpression.TypeDefines some exclusive types of strategy calls.-
Nested classes/interfaces inherited from class net.ssehub.easy.instantiation.core.model.expressions.CallExpression
CallExpression.CallType
-
-
Field Summary
Fields Modifier and Type Field Description private booleanexecResolvedprivate VariableDeclarationnameVarprivate StrategyCallExpression.Typetypeprivate TypeRegistrytypeRegistry
-
Constructor Summary
Constructors Constructor Description StrategyCallExpression()Constructor for serialization.StrategyCallExpression(java.lang.Object parent, java.lang.String name, CallArgument... arguments)Creates a new instantator strategy call.StrategyCallExpression(java.lang.Object parent, java.lang.String name, Expression... arguments)Creates a new instantiator strategy call.StrategyCallExpression(VariableDeclaration nameVar, CallArgument... arguments)Creates a new system execution strategy call.StrategyCallExpression(VariableDeclaration nameVar, Expression... arguments)Creates a new system execution strategy call.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectaccept(IExpressionVisitor visitor)Visits the expression.protected TypeDescriptor<?>determineOperand()Determines the operand for searching operations on.protected booleandoZeroArgumentTest()Returns whether the zero argument test shall be applied.VariableDeclarationgetNameVariable()Returns the variable declaration holding the actual name.StrategyCallExpression.TypegetType()Returns the type of this call.TypeDescriptor<?>inferType()Infers the type of this expression including the type of the contained sub-expressions.private TypeDescriptor<?>inferTypeExecute()Resolves the expression for system call execution.booleanisPlaceholder()Returns whether this operation is a placeholder, i.e., either the resolved operation is aplaceholder, its signature or its return type does contain aplaceholder type.voidsetTypeRegistry(TypeRegistry registry)Defines the type registry to be used for resolving this call.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.expressions.CallExpression
checkMetaForFirstArgField, getArgument, getArgumentsCount, getCallType, getParent, getResolved, getVilSignature, isDotRightExpression, isIteratingCollectionOperation, isIteratorCall, isOclCompliant
-
Methods inherited from class net.ssehub.easy.instantiation.core.model.expressions.AbstractCallExpression
dynamicDispatch, getName, getParameterType, getPrefix, getQualifiedName, getSignature, getVilSignature, isPlaceholder, resolveOperation, resolveOperation, resolveResolvableOperation
-
Methods inherited from class net.ssehub.easy.instantiation.core.model.expressions.Expression
getFormattingHint, replaceEmptyLine
-
-
-
-
Field Detail
-
type
private StrategyCallExpression.Type type
-
execResolved
private boolean execResolved
-
nameVar
private VariableDeclaration nameVar
-
typeRegistry
private transient TypeRegistry typeRegistry
-
-
Constructor Detail
-
StrategyCallExpression
StrategyCallExpression() throws VilExceptionConstructor for serialization.- Throws:
VilException- shall not happen
-
StrategyCallExpression
public StrategyCallExpression(java.lang.Object parent, java.lang.String name, Expression... arguments) throws VilExceptionCreates a new instantiator strategy call.- Parameters:
parent- the parent language unit (if given used as optional parameter during calls)name- the name of the callarguments- the parameter for the call- Throws:
VilException- in case that no argument is given
-
StrategyCallExpression
public StrategyCallExpression(java.lang.Object parent, java.lang.String name, CallArgument... arguments) throws VilExceptionCreates a new instantator strategy call.- Parameters:
parent- the parent language unit (if given used as optional parameter during calls)name- the name of the callarguments- the parameter for the call- Throws:
VilException- in case that no argument is given
-
StrategyCallExpression
public StrategyCallExpression(VariableDeclaration nameVar, Expression... arguments) throws VilException
Creates a new system execution strategy call.- Parameters:
nameVar- the variable holding the actual name/path of the executablearguments- the parameter for the call- Throws:
VilException- in case that no argument is given
-
StrategyCallExpression
public StrategyCallExpression(VariableDeclaration nameVar, CallArgument... arguments) throws VilException
Creates a new system execution strategy call.- Parameters:
nameVar- the variable holding the actual name/path of the executablearguments- the parameter for the call- Throws:
VilException- in case that no argument is given
-
-
Method Detail
-
setTypeRegistry
public void setTypeRegistry(TypeRegistry registry)
Defines the type registry to be used for resolving this call. The type registry is transient and used only during resolution of instantiator calls.- Parameters:
registry- the type registry to use
-
getNameVariable
public VariableDeclaration getNameVariable()
Returns the variable declaration holding the actual name.- Returns:
- the variable declaration holding the actual name
-
doZeroArgumentTest
protected boolean doZeroArgumentTest()
Returns whether the zero argument test shall be applied.- Overrides:
doZeroArgumentTestin classCallExpression- Returns:
trueif the test shall be applied,falseelse
-
getType
public StrategyCallExpression.Type getType()
Returns the type of this call.- Returns:
- the type of this call
-
inferType
public TypeDescriptor<?> inferType() throws VilException
Description copied from class:ExpressionInfers the type of this expression including the type of the contained sub-expressions.- Overrides:
inferTypein classCallExpression- Returns:
- the type of this expression
- Throws:
VilException- in case that inferring the type fails
-
inferTypeExecute
private TypeDescriptor<?> inferTypeExecute() throws VilException
Resolves the expression for system call execution.- Returns:
- the type of executing a system call
- Throws:
VilException- in case that the operands are not compatible
-
determineOperand
protected TypeDescriptor<?> determineOperand() throws VilException
Description copied from class:CallExpressionDetermines the operand for searching operations on. Is called byCallExpression.inferType().- Overrides:
determineOperandin classCallExpression- Returns:
- the operand
- Throws:
VilException- in case that determining the operand fails
-
accept
public java.lang.Object accept(IExpressionVisitor visitor) throws VilException
Description copied from class:ExpressionVisits the expression.- Overrides:
acceptin classCallExpression- Parameters:
visitor- the visitor- Returns:
- the result of visiting this expression (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
isPlaceholder
public boolean isPlaceholder()
Description copied from class:AbstractCallExpressionReturns whether this operation is a placeholder, i.e., either the resolved operation is aplaceholder, its signature or its return type does contain aplaceholder type.- Overrides:
isPlaceholderin classCallExpression- Returns:
trueif this operation is a placeholder and cannot be executed,falseelse
-
-