Class Utils
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.vilTypes.configuration.Utils
-
public class Utils extends java.lang.ObjectSome utility methods. Currently it is unsure how much access to pure variable declarations VIL actually needs. Here are some accessor methods for VIL compliant types but, however, the results are actually not cached!- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Modifier Constructor Description privateUtils()Prevents external creation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidaddField(FieldDescriptor field, java.util.Map<java.lang.String,FieldDescriptor> fields)Adds a descriptor to the given signature-descriptor map.protected static voidaddOperation(OperationDescriptor operation, java.util.Map<java.lang.String,OperationDescriptor> operations)Adds a descriptor to the given signature-descriptor map.protected static TypeDescriptor<?>[]determineGenerics(IDatatype type, TypeRegistry registry, boolean specific)Determines the VIL types for the given generic types.protected static TypeDescriptor<?>determineReturnType(IDatatype type, TypeRegistry registry, boolean specific)Determines the VIL/VTL return type for the given IVMLtype.static IvmlDeclarationgetAttributeDeclaration(Configuration configuration, java.lang.String name)Returns a matching attribute declaration.protected static IMetaOperation.CompatibilityResultisCompatible(java.lang.Object[] params, java.lang.Class<?> paramType)Generic implementation of the compatibility method for one parameter.protected static IMetaOperation.CompatibilityResultisCompatible(java.lang.Object param, java.lang.Class<?> paramType)Generic implementation of the compatibility method for a parameter.protected static IMetaOperation.CompatibilityResultisCompatibleToDecisionVariable(java.lang.Object param)Generic implementation of the compatibility method for a parameter of typeDecisionVariable.protected static IMetaOperation.CompatibilityResultisCompatibleToDecisionVariable(java.lang.Object[] params)Generic implementation of the compatibility method for one parameter of typeDecisionVariable.
-
-
-
Method Detail
-
getAttributeDeclaration
public static IvmlDeclaration getAttributeDeclaration(Configuration configuration, java.lang.String name)
Returns a matching attribute declaration.- Parameters:
configuration- the configuration to return the declaration forname- the name of the attribute to be returned- Returns:
- the attribute declaration or null if not found
-
determineReturnType
protected static TypeDescriptor<?> determineReturnType(IDatatype type, TypeRegistry registry, boolean specific) throws VilException
Determines the VIL/VTL return type for the given IVMLtype.- Parameters:
type- the IVML typeregistry- the actual type registry (may be null, result is thenIvmlTypes.decisionVariableType()specific- resolve for the specific IVML type or for IVML specific dynamic type descriptors- Returns:
- the return type
- Throws:
VilException- in case that creating the type fails
-
determineGenerics
protected static TypeDescriptor<?>[] determineGenerics(IDatatype type, TypeRegistry registry, boolean specific) throws VilException
Determines the VIL types for the given generic types.- Parameters:
type- the type to take the generic types fromregistry- the actual type registry (may be null, result is thenIvmlTypes.decisionVariableType()specific- resolve for the specific IVML type or for IVML specific dynamic type descriptors- Returns:
- the generic types
- Throws:
VilException- in case that creating a type fails
-
isCompatibleToDecisionVariable
protected static IMetaOperation.CompatibilityResult isCompatibleToDecisionVariable(java.lang.Object param)
Generic implementation of the compatibility method for a parameter of typeDecisionVariable.- Parameters:
param- the actual parameter- Returns:
- the compatibility result
-
isCompatibleToDecisionVariable
protected static IMetaOperation.CompatibilityResult isCompatibleToDecisionVariable(java.lang.Object[] params)
Generic implementation of the compatibility method for one parameter of typeDecisionVariable.- Parameters:
params- the actual parameters- Returns:
- the compatibility result
-
isCompatible
protected static IMetaOperation.CompatibilityResult isCompatible(java.lang.Object[] params, java.lang.Class<?> paramType)
Generic implementation of the compatibility method for one parameter.- Parameters:
params- the actual parametersparamType- the expected parameter type- Returns:
- the compatibility result
-
isCompatible
protected static IMetaOperation.CompatibilityResult isCompatible(java.lang.Object param, java.lang.Class<?> paramType)
Generic implementation of the compatibility method for a parameter.- Parameters:
param- the actual parameterparamType- the expected parameter type- Returns:
- the compatibility result
-
addOperation
protected static void addOperation(OperationDescriptor operation, java.util.Map<java.lang.String,OperationDescriptor> operations)
Adds a descriptor to the given signature-descriptor map.- Parameters:
operation- the operation to be addedoperations- the operations (signature-descriptor) (to be modified as a side effect)
-
addField
protected static void addField(FieldDescriptor field, java.util.Map<java.lang.String,FieldDescriptor> fields)
Adds a descriptor to the given signature-descriptor map.- Parameters:
field- the field to be addedfields- the operations (signature-descriptor) (to be modified as a side effect)
-
-