Class IvmlOperationDescriptor
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.vilTypes.OperationDescriptor
-
- net.ssehub.easy.instantiation.core.model.vilTypes.configuration.IvmlOperationDescriptor
-
- All Implemented Interfaces:
IMetaOperation
- Direct Known Subclasses:
AbstractIvmlTypeOperationDescriptor,IvmlComparisonOperationDescriptor,IvmlConfigurationConversionOperationDescriptor,IvmlConfigurationOperationDescriptor,IvmlConstructorOperationDescriptor,IvmlConversionOperationDescriptor,IvmlOrderedEnumComparisonOperationDescriptor,IvmlOrderedEnumMinMaxOperationDescriptor,IvmlSequenceConversionOperationDescriptor,IvmlSetConversionOperationDescriptor
abstract class IvmlOperationDescriptor extends OperationDescriptor
Implements a delegating operation descriptor, i.e., virtual operations representing access to IVML configuration data.- Author:
- Holger Eichelberger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.ssehub.easy.instantiation.core.model.vilTypes.OperationDescriptor
OperationDescriptor.AliasType
-
Nested classes/interfaces inherited from interface net.ssehub.easy.instantiation.core.model.vilTypes.IMetaOperation
IMetaOperation.CompatibilityResult
-
-
Field Summary
-
Fields inherited from class net.ssehub.easy.instantiation.core.model.vilTypes.OperationDescriptor
CONSTRUCTOR_NAME, EMPTY_PARAMETER
-
-
Constructor Summary
Constructors Constructor Description IvmlOperationDescriptor(TypeDescriptor<?> declaringType, java.lang.String name, boolean isConstructor)Creates a new operation descriptor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static <T> TconvertArgument(java.lang.Object arg, java.lang.Class<T> cls)Converts an argument value to an instance ofclsif possible.protected static java.util.List<TypeDescriptor<?>>createParameterList(TypeDescriptor<?> param)Creates a parameter list for one parameter (type).protected java.lang.StringgetDeclaringTypeNameFallback()Returns the name of the declaring type in case thatOperationDescriptor.getDeclaringType()is null.java.lang.StringgetJavaSignature()Returns the Java signature of the method (public for testing).protected voidinitializeParameters()Initializes the parameters (lazy init).protected voidinitializeReturnType()Initializes the return type (lazy init).booleanisFirstParameterOperand()Returns whether the first parameter is the operand.booleanisPlaceholder()Returns whether this operation is valid or whether it is a placeholder operation in case that the original operation cannot be resolved but the script shall remain executable.booleanisStatic()Returns whether this operation is static.booleanstoreArtifactsBeforeExecution()Returns whether artifacts shall be stored before execution of this operation.intuseGenericParameterAsReturn()Returns whether a generc parameter of the operand shall be used as return type.intuseParameterAsReturn()Returns whether a parameter shall be used as return type.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.vilTypes.OperationDescriptor
acceptsImplicitParameters, acceptsNamedParameters, allowsAggregation, composeExceptionMessage, convertVariables, flatten, getAliasType, getDeclaringType, getDeclaringTypeName, getName, getOperationType, getParameter, getParameter, getParameterCount, getParameterType, getRequiredParameterCount, getReturnType, getSignature, getStoredName, isAlias, isConstructor, isConstructor, isConversion, isGenericCollectionOperation, isIteratingCollectionOperation, isOclCompliant, isOperation, isSameSignature, isTypeSelect, requiresDynamicExpressionProcessing, setCharacteristics, setParameters, setReturnType, specializeFor, throwIncompatibleParameter, toString, trace, useAny, useOperandTypeAsParameter
-
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.vilTypes.IMetaOperation
invoke, isCompatible
-
-
-
-
Constructor Detail
-
IvmlOperationDescriptor
IvmlOperationDescriptor(TypeDescriptor<?> declaringType, java.lang.String name, boolean isConstructor)
Creates a new operation descriptor. Overriding constructors shall call#setCharacteristics(OperationType, AliasType, boolean)in order to redefined the default values.- Parameters:
declaringType- the declaring typename- the alias name (may be null if the original name ofmethodshall be used)isConstructor- whether the operation is a constructor
-
-
Method Detail
-
initializeParameters
protected void initializeParameters()
Description copied from class:OperationDescriptorInitializes the parameters (lazy init). Is called byOperationDescriptor.initialize(). Shall callOperationDescriptor.setParameters(List, boolean, boolean).- Specified by:
initializeParametersin classOperationDescriptor
-
initializeReturnType
protected void initializeReturnType()
Description copied from class:OperationDescriptorInitializes the return type (lazy init). Is called byOperationDescriptor.initialize(). Shall callOperationDescriptor.setReturnType(TypeDescriptor).- Specified by:
initializeReturnTypein classOperationDescriptor
-
createParameterList
protected static java.util.List<TypeDescriptor<?>> createParameterList(TypeDescriptor<?> param)
Creates a parameter list for one parameter (type).- Parameters:
param- the parameter type- Returns:
- the parameter list
-
getDeclaringTypeNameFallback
protected java.lang.String getDeclaringTypeNameFallback()
Description copied from class:OperationDescriptorReturns the name of the declaring type in case thatOperationDescriptor.getDeclaringType()is null.- Specified by:
getDeclaringTypeNameFallbackin classOperationDescriptor- Returns:
- the name of the declaring type
-
isStatic
public boolean isStatic()
Description copied from interface:IMetaOperationReturns whether this operation is static.- Returns:
trueif it is static,falseelse
-
isFirstParameterOperand
public boolean isFirstParameterOperand()
Description copied from interface:IMetaOperationReturns whether the first parameter is the operand.- Returns:
trueif the first parameter is the operand,falseelse
-
getJavaSignature
public java.lang.String getJavaSignature()
Description copied from class:OperationDescriptorReturns the Java signature of the method (public for testing).- Specified by:
getJavaSignaturein interfaceIMetaOperation- Specified by:
getJavaSignaturein classOperationDescriptor- Returns:
- the Java signature of the method
-
isPlaceholder
public boolean isPlaceholder()
Description copied from interface:IMetaOperationReturns whether this operation is valid or whether it is a placeholder operation in case that the original operation cannot be resolved but the script shall remain executable.- Returns:
trueif this operation is a placeholder,falseelse
-
useGenericParameterAsReturn
public int useGenericParameterAsReturn()
Description copied from class:OperationDescriptorReturns whether a generc parameter of the operand shall be used as return type.- Specified by:
useGenericParameterAsReturnin classOperationDescriptor- Returns:
- the parameter to be used as index number, negative if none
-
useParameterAsReturn
public int useParameterAsReturn()
Description copied from class:OperationDescriptorReturns whether a parameter shall be used as return type.- Specified by:
useParameterAsReturnin classOperationDescriptor- Returns:
- the parameter to be used as index number, negative if none
-
storeArtifactsBeforeExecution
public boolean storeArtifactsBeforeExecution()
Description copied from class:OperationDescriptorReturns whether artifacts shall be stored before execution of this operation.- Specified by:
storeArtifactsBeforeExecutionin classOperationDescriptor- Returns:
trueif artifacts shall be stored,falseelse
-
convertArgument
protected static <T> T convertArgument(java.lang.Object arg, java.lang.Class<T> cls)Converts an argument value to an instance ofclsif possible.- Type Parameters:
T- the target type- Parameters:
arg- the argument valuecls- the target class- Returns:
- a value of
clsor null
-
-