Package de.gebit.integrity.ui.utils
Class FixtureTypeWrapper
- java.lang.Object
-
- de.gebit.integrity.ui.utils.FixtureTypeWrapper
-
public class FixtureTypeWrapper extends java.lang.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 void
convertParameterValuesToFixtureDefinedTypes(java.lang.String aFixtureMethodName, java.util.Map<java.lang.String,java.lang.Object> aParameterMap, java.util.List<java.lang.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.java.lang.Object
convertResultValueToFixtureDefinedType(java.lang.String aFixtureMethodName, ResultName aResultName, ValueOrEnumValueOrOperationCollection aValue)
Converts a given result value (collection) to a fixture-method-defined result type.protected org.eclipse.jdt.core.IMethod
findMethod(java.lang.String aMethodName)
Finds a method with a specific name in the encapsulated type.ArbitraryParameterEnumerator
instantiateArbitraryParameterEnumerator()
Determines theArbitraryParameterEnumerator
class to use for the encapsulated fixture type and instantiates it.CustomProposalProvider
instantiateCustomProposalProvider()
Determines theCustomProposalProvider
class to use for the encapsulated fixture type and instantiates it.boolean
isArbitraryParameterFixtureClass()
Checks whether the encapsulated type is an arbitrary parameter fixture class.boolean
isCustomProposalFixtureClass()
Checks whether the encapsulated type is a custom proposal fixture class.
-
-
-
Method Detail
-
findMethod
protected org.eclipse.jdt.core.IMethod findMethod(java.lang.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(java.lang.String aFixtureMethodName, java.util.Map<java.lang.String,java.lang.Object> aParameterMap, java.util.List<java.lang.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.JavaModelException
UnexecutableException
ParameterUtil.UnresolvableVariableException
-
convertResultValueToFixtureDefinedType
public java.lang.Object convertResultValueToFixtureDefinedType(java.lang.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 theArbitraryParameterEnumerator
class 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 theCustomProposalProvider
class to use for the encapsulated fixture type and instantiates it.- Returns:
- the custom proposal provider
-
-