Class SimpleConversion

    • Constructor Detail

      • SimpleConversion

        public SimpleConversion()
    • Method Detail

      • to

        public Assignment to​(ConversionContext conversionContext)
        Description copied from interface: ConversionProvider
        Creates the conversion from source to target of a property mapping.
        Specified by:
        to in interface ConversionProvider
        Parameters:
        conversionContext - ConversionContext providing optional information required for creating the conversion.
        Returns:
        A conversion from source to target.
      • from

        public Assignment from​(ConversionContext conversionContext)
        Description copied from interface: ConversionProvider
        Creates the conversion from target to source of a property mapping.
        Specified by:
        from in interface ConversionProvider
        Parameters:
        conversionContext - ConversionContext providing optional information required for creating the conversion.
        Returns:
        A conversion from target to source.
      • getToExpression

        protected abstract String getToExpression​(ConversionContext conversionContext)
        Returns the conversion string from source to target. The placeholder <SOURCE> can be used to represent a reference to the source value.
        Parameters:
        conversionContext - A context providing optional information required for creating the conversion.
        Returns:
        The conversion string from source to target
      • getFromExpression

        protected abstract String getFromExpression​(ConversionContext conversionContext)
        Returns the conversion string from target to source. The placeholder <SOURCE> can be used to represent a reference to the target value.
        Parameters:
        conversionContext - ConversionContext providing optional information required for creating the conversion.
        Returns:
        The conversion string from target to source
      • getFromConversionImportTypes

        protected Set<Type> getFromConversionImportTypes​(ConversionContext conversionContext)
        Returns a set with imported types of the "from" conversion. Defaults to an empty set; can be overridden in sub-classes to return the required types.
        Parameters:
        conversionContext - the conversion context
        Returns:
        conversion types required in the "from" conversion
      • getToConversionImportTypes

        protected Set<Type> getToConversionImportTypes​(ConversionContext conversionContext)
        Returns a set with imported types of the "to" conversion. Defaults to an empty set; can be overridden in sub-classes to return the required types.
        Parameters:
        conversionContext - the conversion context
        Returns:
        conversion types required in the "to" conversion
      • getToConversionExceptionTypes

        protected List<Type> getToConversionExceptionTypes​(ConversionContext conversionContext)
      • getFromConversionExceptionTypes

        protected List<Type> getFromConversionExceptionTypes​(ConversionContext conversionContext)