Class Utils
java.lang.Object
eu.qualimaster.easy.extension.internal.Utils
Utility methods.
- Author:
- Holger Eichelberger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddRuntimeAttributeToProject(net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType) Adds the binding time attribute toproject.static net.ssehub.easy.varModel.model.FreezeBlockcreateFreezeBlock(List<net.ssehub.easy.varModel.model.IFreezable> freezables, net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType) Creates a freeze block for project.static net.ssehub.easy.varModel.model.FreezeBlockcreateFreezeBlock(net.ssehub.easy.varModel.model.IFreezable[] freezables, net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType) Creates a freeze block for project.static net.ssehub.easy.varModel.model.FreezeBlockcreateFreezeBlock(net.ssehub.easy.varModel.model.Project project) Adds a freeze block to the project containing all elements.static net.ssehub.easy.varModel.confModel.IDecisionVariableextractVariable(net.ssehub.easy.varModel.model.values.ReferenceValue refValue, net.ssehub.easy.varModel.confModel.Configuration config) Extracts anIDecisionVariablefrom the givenReferenceValue.static List<net.ssehub.easy.varModel.confModel.IDecisionVariable> extractVariables(net.ssehub.easy.varModel.model.values.ContainerValue refValues, net.ssehub.easy.varModel.confModel.Configuration config) Extracts all referencedIDecisionVariables from a container ofReferenceValues.static net.ssehub.easy.varModel.confModel.IDecisionVariablefindAlgorithm(net.ssehub.easy.varModel.confModel.IDecisionVariable family, String name, boolean asReference) Finds an algorithm infamily.static net.ssehub.easy.varModel.model.datatypes.CompoundfindCompound(net.ssehub.easy.varModel.model.Project project, String name) Finds a compound type.static net.ssehub.easy.varModel.confModel.IDecisionVariablefindNamedVariable(net.ssehub.easy.varModel.confModel.Configuration config, net.ssehub.easy.varModel.model.datatypes.IDatatype type, String name) Finds a named variable and throws an exception if not found.
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
findCompound
public static net.ssehub.easy.varModel.model.datatypes.Compound findCompound(net.ssehub.easy.varModel.model.Project project, String name) throws net.ssehub.easy.varModel.model.ModelQueryException Finds a compound type.- Parameters:
project- the project to start searchingname- the name of the compound- Returns:
- the compound type or null if none was found
- Throws:
net.ssehub.easy.varModel.model.ModelQueryException- in case of violated project access restrictions
-
findNamedVariable
public static net.ssehub.easy.varModel.confModel.IDecisionVariable findNamedVariable(net.ssehub.easy.varModel.confModel.Configuration config, net.ssehub.easy.varModel.model.datatypes.IDatatype type, String name) throws net.ssehub.easy.varModel.model.ModelQueryException Finds a named variable and throws an exception if not found.- Parameters:
config- the configuration to search withintype- the type of the variablename- the name of the variable- Returns:
- the variable
- Throws:
net.ssehub.easy.varModel.model.ModelQueryException- if not found
-
findAlgorithm
public static net.ssehub.easy.varModel.confModel.IDecisionVariable findAlgorithm(net.ssehub.easy.varModel.confModel.IDecisionVariable family, String name, boolean asReference) throws net.ssehub.easy.varModel.model.ModelQueryException Finds an algorithm infamily.- Parameters:
family- the familyname- the name of the algorithmasReference- return the reference to the algorithm or the algorithm itself- Returns:
- the algorithm or its reference (depending on
asReference) - Throws:
net.ssehub.easy.varModel.model.ModelQueryException- if the algorithm cannot be found
-
createFreezeBlock
public static net.ssehub.easy.varModel.model.FreezeBlock createFreezeBlock(List<net.ssehub.easy.varModel.model.IFreezable> freezables, net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType) throws net.ssehub.easy.varModel.cst.CSTSemanticException, net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException, net.ssehub.easy.varModel.model.ModelQueryException Creates a freeze block for project. [legacy style, does not add to project]- Parameters:
freezables- the freezablesproject- the IVML project to add to (may be null if failed)fallbackForType- in case thatprojectis being written the first time, may be null- Returns:
- the created freeze block
- Throws:
net.ssehub.easy.varModel.cst.CSTSemanticException- in case of CST errorsnet.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException- in case of unmatching valuesnet.ssehub.easy.varModel.model.ModelQueryException- in case of model access problems
-
createFreezeBlock
public static net.ssehub.easy.varModel.model.FreezeBlock createFreezeBlock(net.ssehub.easy.varModel.model.IFreezable[] freezables, net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType) throws net.ssehub.easy.varModel.cst.CSTSemanticException, net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException, net.ssehub.easy.varModel.model.ModelQueryException Creates a freeze block for project. [legacy style, does not add to project]- Parameters:
freezables- the freezablesproject- the IVML project to add to (may be null if failed)fallbackForType- in case thatprojectis being written the first time, may be null- Returns:
- the created freeze block
- Throws:
net.ssehub.easy.varModel.cst.CSTSemanticException- in case of CST errorsnet.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException- in case of unmatching valuesnet.ssehub.easy.varModel.model.ModelQueryException- in case of model access problems
-
createFreezeBlock
public static net.ssehub.easy.varModel.model.FreezeBlock createFreezeBlock(net.ssehub.easy.varModel.model.Project project) throws net.ssehub.easy.varModel.cst.CSTSemanticException, net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException, net.ssehub.easy.varModel.model.ModelQueryException Adds a freeze block to the project containing all elements.- Parameters:
project- the IVML project to freeze- Returns:
- the created freeze block
- Throws:
net.ssehub.easy.varModel.cst.CSTSemanticException- in case of CST errorsnet.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException- in case of unmatching valuesnet.ssehub.easy.varModel.model.ModelQueryException- in case of model access problems
-
addRuntimeAttributeToProject
public static void addRuntimeAttributeToProject(net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType) throws net.ssehub.easy.varModel.cst.CSTSemanticException, net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException, net.ssehub.easy.varModel.model.ModelQueryException Adds the binding time attribute toproject.- Parameters:
project- the IVML project to add the attribute tofallbackForType- in case thatprojectis being written the first time, may be null- Throws:
net.ssehub.easy.varModel.cst.CSTSemanticException- in case of CST errorsnet.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException- in case of unmatching valuesnet.ssehub.easy.varModel.model.ModelQueryException- in case of model access problems
-
extractVariable
public static net.ssehub.easy.varModel.confModel.IDecisionVariable extractVariable(net.ssehub.easy.varModel.model.values.ReferenceValue refValue, net.ssehub.easy.varModel.confModel.Configuration config) Extracts anIDecisionVariablefrom the givenReferenceValue.- Parameters:
refValue- A value pointing to an element of a pipeline.config- The complete configuration form where to take theIDecisionVariable.- Returns:
- The referenced
IDecisionVariableor in case of any errorsnull.
-
extractVariables
public static List<net.ssehub.easy.varModel.confModel.IDecisionVariable> extractVariables(net.ssehub.easy.varModel.model.values.ContainerValue refValues, net.ssehub.easy.varModel.confModel.Configuration config) Extracts all referencedIDecisionVariables from a container ofReferenceValues.- Parameters:
refValues- A value pointing other declarations, must not use an expression.config- The complete configuration form where to take theIDecisionVariable.- Returns:
- The referenced
IDecisionVariables or an empty list in case of any errors.
-