Class VariableDeclaration
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.common.VariableDeclaration
-
- net.ssehub.easy.instantiation.core.model.buildlangModel.VariableDeclaration
-
- All Implemented Interfaces:
IVariable,IBuildlangElement,IRuleElement,ILanguageElement,IModifierHolder,IResolvable,IMetaParameterDeclaration
- Direct Known Subclasses:
ImplicitVariableDeclaration,JoinVariableDeclaration
public class VariableDeclaration extends VariableDeclaration implements IBuildlangElement, IRuleElement, IResolvable
Represents a variable declaration. Parent instances are responsible for setting the right parent.- Author:
- Christian Kröher, Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private ILanguageElementparent
-
Constructor Summary
Constructors Constructor Description VariableDeclaration()Constructor for serializer.VariableDeclaration(java.lang.String name, TypeDescriptor<?> type)Creates a new variable declaration.VariableDeclaration(java.lang.String name, TypeDescriptor<?> type, boolean isConstant, Expression expression)Creates a new variable declaration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectaccept(IVisitor visitor)Accepts the visitor for visiting.ILanguageElementgetParent()Returns the parent element.protected voidsetParent(ILanguageElement parent)Changes the parent.-
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
-
-
-
-
Field Detail
-
parent
private ILanguageElement parent
-
-
Constructor Detail
-
VariableDeclaration
VariableDeclaration()
Constructor for serializer.
-
VariableDeclaration
public VariableDeclaration(java.lang.String name, TypeDescriptor<?> type)Creates a new variable declaration.- Parameters:
name- the name of the variabletype- the type of the variable
-
VariableDeclaration
public VariableDeclaration(java.lang.String name, TypeDescriptor<?> type, boolean isConstant, Expression expression)Creates a new variable declaration.- Parameters:
name- the name of the variabletype- the type of the variableisConstant- whether this variable is a constantexpression- an expression denoting the initial value (may be null)
-
-
Method Detail
-
accept
public java.lang.Object accept(IVisitor visitor) throws VilException
Description copied from interface:IBuildlangElementAccepts the visitor for visiting.- Specified by:
acceptin interfaceIBuildlangElement- 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)
-
getParent
public ILanguageElement getParent()
Description copied from interface:ILanguageElementReturns the parent element.- Specified by:
getParentin interfaceILanguageElement- Returns:
- the parent element (may be null if unknown)
-
setParent
protected void setParent(ILanguageElement parent)
Changes the parent. Please override if children must be adjusted according. Shall be called only once per instance, but there is no limitation.- Parameters:
parent- the parent
-
-