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 Detail

      • 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 type
        aParameterizedType - the parameterized (via generics) type attached to the given target type, if applicable - for example if a conversion to List is desired, the target type is List, and the parameterized type is Integer
        aValue - the value
        aConversionContext - controls some conversion parameters and rules; may be null if the default ConversionContext 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 default ConversionContext 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 default ConversionContext 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 default ConversionContext 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 default ConversionContext values shall be used
        Returns:
        the string array