Interface ValueConverter
-
- All Known Implementing Classes:
AbstractModularValueConverter
,DefaultModularValueConverter
public interface ValueConverter
The 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 java.lang.Object
convertValue(java.lang.Class<?> aTargetType, java.lang.Class<?> aParameterizedType, java.lang.Object aValue, ConversionContext aConversionContext)
Convert a given single Integrity or Java type value to a given target type (which is always a Java type).java.lang.Object
convertValue(java.lang.Class<?> aTargetType, java.lang.Object aValue, ConversionContext aConversionContext)
Convert a given single Integrity or Java type value to a given target type (which is always a Java type).FormattedString
convertValueToFormattedString(java.lang.Object aValue, boolean aForceIntermediateMapFlag, ConversionContext aConversionContext)
Converts a given value to a formattedString.FormattedString[]
convertValueToFormattedStringArray(java.lang.Object aValue, ConversionContext aConversionContext)
Converts a given value to a formatted String array.java.lang.String
convertValueToString(java.lang.Object aValue, boolean aForceIntermediateMapFlag, ConversionContext aConversionContext)
Converts a given value to a String.java.lang.String[]
convertValueToStringArray(java.lang.Object aValue, ConversionContext aConversionContext)
Converts a given value to a String array.
-
-
-
Method Detail
-
convertValue
java.lang.Object convertValue(java.lang.Class<?> aTargetType, java.lang.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 defaultConversionContext
values shall be used- Returns:
- the converted object
- Throws:
ParameterUtil.UnresolvableVariableException
UnexecutableException
-
convertValue
java.lang.Object convertValue(java.lang.Class<?> aTargetType, java.lang.Class<?> aParameterizedType, java.lang.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 defaultConversionContext
values shall be used- Returns:
- the converted object
- Throws:
ParameterUtil.UnresolvableVariableException
UnexecutableException
-
convertValueToString
java.lang.String convertValueToString(java.lang.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 defaultConversionContext
values shall be used- Returns:
- the string
-
convertValueToFormattedString
FormattedString convertValueToFormattedString(java.lang.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 defaultConversionContext
values shall be used- Returns:
- the string
-
convertValueToStringArray
java.lang.String[] convertValueToStringArray(java.lang.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 defaultConversionContext
values shall be used- Returns:
- the string array
-
convertValueToFormattedStringArray
FormattedString[] convertValueToFormattedStringArray(java.lang.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 defaultConversionContext
values shall be used- Returns:
- the string array
-
-