Class VariableCreator
java.lang.Object
net.ssehub.easy.varModel.confModel.VariableCreator
- All Implemented Interfaces:
IDatatypeVisitor
Factory for converting
AbstractVariable into DecisionVariable.
Creates the DecisionVariable and sets the default value if possible.- Author:
- El-Sharkawy, Holger Eichelberger
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ConfigurationExceptionprivate booleanprivate booleanprivate IConfigurationElementprivate AbstractVariableprivate IDecisionVariable -
Constructor Summary
ConstructorsConstructorDescriptionVariableCreator(AbstractVariable varDecl, IConfigurationElement parent, boolean isVisible, boolean isAttribute) Sole constructor for this class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the created variable.(package private) IDecisionVariablegetVariable(boolean setDefaultValue) Return theIDecisionVariableas ingetVariable().voidvisitAnyType(AnyType datatype) Is called by an AnyType.voidvisitBooleanType(BooleanType type) Visiting method for visiting aBooleanType.voidvisitCompoundType(Compound compound) Visiting method for visiting aCompound.voidVisiting method for visiting aConstraintType.voidvisitDatatype(IDatatype datatype) Is called by an arbitrary data type.voidvisitDerivedType(DerivedDatatype datatype) Is called by anDerivedDatatypedata type.voidvisitEnumType(Enum enumType) Visiting method for visiting aEnum.voidvisitIntegerType(IntegerType type) Visiting method for visiting aIntegerType.voidvisitMetaType(MetaType datatype) Is called by a MetaType.voidvisitOrderedEnumType(OrderedEnum enumType) Visiting method for visiting aOrderredEnum.voidvisitRealType(RealType type) Visiting method for visiting aRealType.voidvisitReference(Reference reference) Is called by a reference data type.voidvisitSequence(Sequence sequence) Is called by a sequence datatype.voidIs called by a set data type.voidvisitStringType(StringType type) Visiting method for visiting aStringType.voidvisitVersionType(VersionType type) Visiting method for visiting aVersionType.
-
Field Details
-
variable
-
parent
-
varDecl
-
configExcetion
-
isVisible
private boolean isVisible -
isAttribute
private boolean isAttribute
-
-
Constructor Details
-
VariableCreator
public VariableCreator(AbstractVariable varDecl, IConfigurationElement parent, boolean isVisible, boolean isAttribute) Sole constructor for this class.- Parameters:
varDecl- The specification of the variable which should be createdparent- The parent this variable is part of, typically theConfigurationinstance, but in case of compounds also the containingDecisionVariableisVisible- Specifies whether this variables is exported by an interface or not:true: The variable is exported by an interface or there is no interface.false: There is an interface which does not export this variable.
isAttribute- whether a variable represents (as part of) an attribute or an usual variable shall be created
-
-
Method Details
-
getVariable
Returns the created variable.- Returns:
- The
DecisionVariablerepresenting the givenAbstractVariable. - Throws:
ConfigurationException- in case that the types ofAbstractVariableandDecisionVariabledo not comply
-
getVariable
Return theIDecisionVariableas ingetVariable(). However, during the initialization ofNestedVarConfigProviderthe usage of the DefaultValueSetter will causeNullPointerExceptions. Therefore, this method withsetDefaultValue = falseshould be used inside the initialization of nestedIDecisionVariables.- Parameters:
setDefaultValue-trueif the default value should be set for the newly createdIDecisionVariable, otherwisefalse.- Returns:
- The
IDecisionVariablerepresenting the givenAbstractVariable, which was created by running the constructor of this class. - Throws:
ConfigurationException- in case that the types ofAbstractVariableandDecisionVariabledo not comply
-
visitDatatype
Description copied from interface:IDatatypeVisitorIs called by an arbitrary data type.- Specified by:
visitDatatypein interfaceIDatatypeVisitor- Parameters:
datatype- the data type.
-
visitAnyType
Description copied from interface:IDatatypeVisitorIs called by an AnyType.- Specified by:
visitAnyTypein interfaceIDatatypeVisitor- Parameters:
datatype- the data type.
-
visitMetaType
Description copied from interface:IDatatypeVisitorIs called by a MetaType.- Specified by:
visitMetaTypein interfaceIDatatypeVisitor- Parameters:
datatype- the data type.
-
visitDerivedType
Description copied from interface:IDatatypeVisitorIs called by anDerivedDatatypedata type.- Specified by:
visitDerivedTypein interfaceIDatatypeVisitor- Parameters:
datatype- the data type.
-
visitSet
Description copied from interface:IDatatypeVisitorIs called by a set data type.- Specified by:
visitSetin interfaceIDatatypeVisitor- Parameters:
set- the set instance
-
visitSequence
Description copied from interface:IDatatypeVisitorIs called by a sequence datatype.- Specified by:
visitSequencein interfaceIDatatypeVisitor- Parameters:
sequence- the sequence instance
-
visitReference
Description copied from interface:IDatatypeVisitorIs called by a reference data type.- Specified by:
visitReferencein interfaceIDatatypeVisitor- Parameters:
reference- the references instance
-
visitBooleanType
Description copied from interface:IDatatypeVisitorVisiting method for visiting aBooleanType.- Specified by:
visitBooleanTypein interfaceIDatatypeVisitor- Parameters:
type- TheIDatatypewhich should be visited.
-
visitStringType
Description copied from interface:IDatatypeVisitorVisiting method for visiting aStringType.- Specified by:
visitStringTypein interfaceIDatatypeVisitor- Parameters:
type- TheIDatatypewhich should be visited.
-
visitConstraintType
Description copied from interface:IDatatypeVisitorVisiting method for visiting aConstraintType.- Specified by:
visitConstraintTypein interfaceIDatatypeVisitor- Parameters:
type- TheIDatatypewhich should be visited.
-
visitIntegerType
Description copied from interface:IDatatypeVisitorVisiting method for visiting aIntegerType.- Specified by:
visitIntegerTypein interfaceIDatatypeVisitor- Parameters:
type- TheIDatatypewhich should be visited.
-
visitRealType
Description copied from interface:IDatatypeVisitorVisiting method for visiting aRealType.- Specified by:
visitRealTypein interfaceIDatatypeVisitor- Parameters:
type- TheIDatatypewhich should be visited.
-
visitCompoundType
Description copied from interface:IDatatypeVisitorVisiting method for visiting aCompound.- Specified by:
visitCompoundTypein interfaceIDatatypeVisitor- Parameters:
compound- TheCompoundwhich should be visited.
-
visitEnumType
Description copied from interface:IDatatypeVisitorVisiting method for visiting aEnum.- Specified by:
visitEnumTypein interfaceIDatatypeVisitor- Parameters:
enumType- TheEnumwhich should be visited.
-
visitOrderedEnumType
Description copied from interface:IDatatypeVisitorVisiting method for visiting aOrderredEnum.- Specified by:
visitOrderedEnumTypein interfaceIDatatypeVisitor- Parameters:
enumType- TheEnumwhich should be visited.
-
visitVersionType
Description copied from interface:IDatatypeVisitorVisiting method for visiting aVersionType.- Specified by:
visitVersionTypein interfaceIDatatypeVisitor- Parameters:
type- TheIDatatypewhich should be visited.
-