Class JoinVariableDeclaration
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.common.VariableDeclaration
-
- net.ssehub.easy.instantiation.core.model.buildlangModel.VariableDeclaration
-
- net.ssehub.easy.instantiation.core.model.buildlangModel.JoinVariableDeclaration
-
- All Implemented Interfaces:
IVariable,IBuildlangElement,IRuleElement,ILanguageElement,IModifierHolder,IResolvable,IMetaParameterDeclaration
public class JoinVariableDeclaration extends VariableDeclaration
Defines a variable declaration for VIL joins.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private booleanexclude
-
Constructor Summary
Constructors Constructor Description JoinVariableDeclaration(java.lang.String name, Expression expr, boolean exclude)Creates a new variable declaration.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectaccept(IVisitor visitor)Accepts the visitor for visiting.private static TypeDescriptor<?>getJoinVariableType(Expression expr)Determine the type of the join variable from the initializing expression.booleanisExcluded()Returns whether this variable shall be excluded from the join result.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.buildlangModel.VariableDeclaration
getParent, setParent
-
Methods inherited from class net.ssehub.easy.instantiation.core.model.common.VariableDeclaration
accept, addModifier, getExpression, getModifier, getModifierCount, getName, getParameter, getRequiredParameterCount, getType, hasExplicitType, hasModifier, isConstant, isImplicit, mapDefaultedParameters, resolveOperation, setHasExplicitType, setIsConstant, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.ssehub.easy.instantiation.core.model.expressions.IResolvable
getName
-
-
-
-
Constructor Detail
-
JoinVariableDeclaration
public JoinVariableDeclaration(java.lang.String name, Expression expr, boolean exclude) throws VilExceptionCreates a new variable declaration.- Parameters:
name- the name of the variableexpr- the initializing expression (must be given)exclude- if this join variable shall be excluded from the join result- Throws:
VilException- in case of structural or semantic errors
-
-
Method Detail
-
getJoinVariableType
private static TypeDescriptor<?> getJoinVariableType(Expression expr) throws VilException
Determine the type of the join variable from the initializing expression.- Parameters:
expr- the expression used for the initialization- Returns:
- the actual type of the join variable
- Throws:
VilException- in case thatexpris not a collection or does not have exactly one parameter
-
isExcluded
public boolean isExcluded()
Returns whether this variable shall be excluded from the join result.- Returns:
trueif it shall be excluded,falseelse
-
accept
public java.lang.Object accept(IVisitor visitor) throws VilException
Description copied from interface:IBuildlangElementAccepts the visitor for visiting.- Specified by:
acceptin interfaceIBuildlangElement- Overrides:
acceptin classVariableDeclaration- Parameters:
visitor- the visitor to be used- Returns:
- the result of visiting this instance (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
-