Package de.gebit.integrity.ui.utils
Class FixtureTypeWrapper
- java.lang.Object
-
- de.gebit.integrity.ui.utils.FixtureTypeWrapper
-
public class FixtureTypeWrapper extends Object
Wrapper used in a similar fashion as theFixtureWrapper. It encapsulates an IType object and provides methods required when accessing the type during autocompletion etc.- Author:
- Rene Schneider - initial API and implementation
-
-
Constructor Summary
Constructors Constructor Description FixtureTypeWrapper(org.eclipse.jdt.core.IType aFixtureType)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconvertParameterValuesToFixtureDefinedTypes(String aFixtureMethodName, Map<String,Object> aParameterMap, List<String> aParameterPath, boolean anIncludeArbitraryParametersFlag)Replaces all values in the given parameter map with converted versions that match the types that are expected by the given fixture method.ObjectconvertResultValueToFixtureDefinedType(String aFixtureMethodName, ResultName aResultName, ValueOrEnumValueOrOperationCollection aValue)Converts a given result value (collection) to a fixture-method-defined result type.protected org.eclipse.jdt.core.IMethodfindMethod(String aMethodName)Finds a method with a specific name in the encapsulated type.ArbitraryParameterEnumeratorinstantiateArbitraryParameterEnumerator()Determines theArbitraryParameterEnumeratorclass to use for the encapsulated fixture type and instantiates it.CustomProposalProviderinstantiateCustomProposalProvider()Determines theCustomProposalProviderclass to use for the encapsulated fixture type and instantiates it.booleanisArbitraryParameterFixtureClass()Checks whether the encapsulated type is an arbitrary parameter fixture class.booleanisCustomProposalFixtureClass()Checks whether the encapsulated type is a custom proposal fixture class.
-
-
-
Method Detail
-
findMethod
protected org.eclipse.jdt.core.IMethod findMethod(String aMethodName) throws org.eclipse.jdt.core.JavaModelException
Finds a method with a specific name in the encapsulated type.- Parameters:
aMethodName- the method name to find- Returns:
- the method if found, null if not
- Throws:
org.eclipse.jdt.core.JavaModelException
-
convertParameterValuesToFixtureDefinedTypes
public void convertParameterValuesToFixtureDefinedTypes(String aFixtureMethodName, Map<String,Object> aParameterMap, List<String> aParameterPath, boolean anIncludeArbitraryParametersFlag) throws org.eclipse.jdt.core.JavaModelException, ParameterUtil.UnresolvableVariableException, UnexecutableException
Replaces all values in the given parameter map with converted versions that match the types that are expected by the given fixture method.- Parameters:
aFixtureMethodName- the method nameaParameterMap- the parameter mapaParameterPath- the path inside a nested object, if applicableanIncludeArbitraryParametersFlag- whether arbitrary parameters shall be included- Throws:
org.eclipse.jdt.core.JavaModelExceptionUnexecutableExceptionParameterUtil.UnresolvableVariableException
-
convertResultValueToFixtureDefinedType
public Object convertResultValueToFixtureDefinedType(String aFixtureMethodName, ResultName aResultName, ValueOrEnumValueOrOperationCollection aValue) throws org.eclipse.jdt.core.JavaModelException
Converts a given result value (collection) to a fixture-method-defined result type. This won't do any variable replacement, since it's designed to be used inside Eclipse!- Parameters:
aFixtureMethodName- the method nameaResultName- the name of the result (may be null if the default result is meant)aValue- the value to convert- Returns:
- the converted value
- Throws:
org.eclipse.jdt.core.JavaModelException
-
isArbitraryParameterFixtureClass
public boolean isArbitraryParameterFixtureClass()
Checks whether the encapsulated type is an arbitrary parameter fixture class.- Returns:
-
instantiateArbitraryParameterEnumerator
public ArbitraryParameterEnumerator instantiateArbitraryParameterEnumerator()
Determines theArbitraryParameterEnumeratorclass to use for the encapsulated fixture type and instantiates it.- Returns:
- the enumerator or null if the class isn't an arbitrary fixture class or if there is no matching enumerator class found in the workspace
-
isCustomProposalFixtureClass
public boolean isCustomProposalFixtureClass()
Checks whether the encapsulated type is a custom proposal fixture class.- Returns:
-
instantiateCustomProposalProvider
public CustomProposalProvider instantiateCustomProposalProvider()
Determines theCustomProposalProviderclass to use for the encapsulated fixture type and instantiates it.- Returns:
- the custom proposal provider
-
-