Class Conversion<FROM,​TO>

    • Constructor Detail

      • Conversion

        public Conversion()
    • Method Detail

      • convert

        public abstract TO convert​(FROM aSource,
                                   java.lang.Class<? extends TO> aTargetType,
                                   ConversionContext aConversionContext)
                            throws ConversionFailedException
        Performs the conversion.
        Parameters:
        aSource - the source object to convert
        aTargetType - TODO
        aConversionContext - controls some conversion parameters and rules; may be null if the default ConversionContext values shall be used
        Returns:
        the converted object
        Throws:
        ConversionFailedException - in case of conversion errors
      • setVisitedObjects

        public void setVisitedObjects​(java.util.Set<java.lang.Object> someVisitedObjects)
      • convertValueRecursive

        protected java.lang.Object convertValueRecursive​(java.lang.Class<?> aTargetType,
                                                         java.lang.Class<?> aParameterizedType,
                                                         java.lang.Object aValue,
                                                         ConversionContext aConversionContext)
                                                  throws ParameterUtil.UnresolvableVariableException,
                                                         java.lang.ClassNotFoundException,
                                                         UnexecutableException,
                                                         java.lang.InstantiationException
        Recursively converts the given value to the defined target type. This method provides implicit protection against endless recursion loops.
        Parameters:
        aTargetType - the target type
        aParameterizedType - the parameterized type in case of generics
        aValue - the value to convert
        aConversionContext - some parameters controlling the conversion (if null, a default context is used)
        Returns:
        the converted value
        Throws:
        ParameterUtil.UnresolvableVariableException
        java.lang.ClassNotFoundException
        UnexecutableException
        java.lang.InstantiationException
      • convertValueToFormattedStringArrayRecursive

        protected FormattedString[] convertValueToFormattedStringArrayRecursive​(java.lang.Object aValue,
                                                                                ConversionContext aConversionContext)
        Recursively converts the given value to a string array. This method provides implicit protection against endless recursion loops.
        Parameters:
        aValue - the value to convert
        aConversionContext - some parameters controlling the conversion (if null, a default context is used)
        Returns:
        the converted string array