Interface ValueConverter
-
- All Known Implementing Classes:
AbstractModularValueConverter,DefaultModularValueConverter
public interface ValueConverterThe value converter is responsible for conversion of values during test execution and/or inside the Eclipse integration.- Author:
- Rene Schneider - initial API and implementation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObjectconvertValue(Class<?> aTargetType, Class<?> aParameterizedType, Object aValue, ConversionContext aConversionContext)Convert a given single Integrity or Java type value to a given target type (which is always a Java type).ObjectconvertValue(Class<?> aTargetType, Object aValue, ConversionContext aConversionContext)Convert a given single Integrity or Java type value to a given target type (which is always a Java type).FormattedStringconvertValueToFormattedString(Object aValue, boolean aForceIntermediateMapFlag, ConversionContext aConversionContext)Converts a given value to a formattedString.FormattedString[]convertValueToFormattedStringArray(Object aValue, ConversionContext aConversionContext)Converts a given value to a formatted String array.StringconvertValueToString(Object aValue, boolean aForceIntermediateMapFlag, ConversionContext aConversionContext)Converts a given value to a String.String[]convertValueToStringArray(Object aValue, ConversionContext aConversionContext)Converts a given value to a String array.
-
-
-
Method Detail
-
convertValue
Object convertValue(Class<?> aTargetType, Object aValue, ConversionContext aConversionContext) throws ParameterUtil.UnresolvableVariableException, UnexecutableException
Convert a given single Integrity or Java type value to a given target type (which is always a Java type).- Parameters:
aTargetType- the target typeaValue- the valueaConversionContext- controls some conversion parameters and rules; may be null if the defaultConversionContextvalues shall be used- Returns:
- the converted object
- Throws:
ParameterUtil.UnresolvableVariableExceptionUnexecutableException
-
convertValue
Object convertValue(Class<?> aTargetType, Class<?> aParameterizedType, Object aValue, ConversionContext aConversionContext) throws ParameterUtil.UnresolvableVariableException, UnexecutableException
Convert a given single Integrity or Java type value to a given target type (which is always a Java type).- Parameters:
aTargetType- the target typeaParameterizedType- the parameterized (via generics) type attached to the given target type, if applicable - for example if a conversion to Listis desired, the target type is List, and the parameterized type is Integer aValue- the valueaConversionContext- controls some conversion parameters and rules; may be null if the defaultConversionContextvalues shall be used- Returns:
- the converted object
- Throws:
ParameterUtil.UnresolvableVariableExceptionUnexecutableException
-
convertValueToString
String convertValueToString(Object aValue, boolean aForceIntermediateMapFlag, ConversionContext aConversionContext)
Converts a given value to a String. This method is intended to be used for the output of values (for example in test results, on the console etc). In comparison to#convertValueToStringArray(Object, UnresolvableVariableHandling), this method always returns only a single String value, concatenating arrays first if necessary.- Parameters:
aValue- the value (can be an Integrity-internal type or a plain Java Object)aForceIntermediateMapFlag- whether the conversion should force the usage of an intermediate map (useful for bean types)aConversionContext- controls some conversion parameters and rules; may be null if the defaultConversionContextvalues shall be used- Returns:
- the string
-
convertValueToFormattedString
FormattedString convertValueToFormattedString(Object aValue, boolean aForceIntermediateMapFlag, ConversionContext aConversionContext)
Converts a given value to a formattedString. This method is intended to be used for the output of values (for example in test results, on the console etc). In comparison to#convertValueToStringArray(Object, UnresolvableVariableHandling), this method always returns only a single String value, concatenating arrays first if necessary.- Parameters:
aValue- the value (can be an Integrity-internal type or a plain Java Object)aForceIntermediateMapFlag- whether the conversion should force the usage of an intermediate map (useful for bean types)aConversionContext- controls some conversion parameters and rules; may be null if the defaultConversionContextvalues shall be used- Returns:
- the string
-
convertValueToStringArray
String[] convertValueToStringArray(Object aValue, ConversionContext aConversionContext)
Converts a given value to a String array. This method is intended to be used for the output of values (for example in test results, on the console etc).- Parameters:
aValue- the value (can be an Integrity-internal type or a plain Java Object)aConversionContext- controls some conversion parameters and rules; may be null if the defaultConversionContextvalues shall be used- Returns:
- the string array
-
convertValueToFormattedStringArray
FormattedString[] convertValueToFormattedStringArray(Object aValue, ConversionContext aConversionContext)
Converts a given value to a formatted String array. This method is intended to be used for the output of values (for example in test results, on the console etc).- Parameters:
aValue- the value (can be an Integrity-internal type or a plain Java Object)aConversionContext- controls some conversion parameters and rules; may be null if the defaultConversionContextvalues shall be used- Returns:
- the string array
-
-