Class SimpleConversion
java.lang.Object
org.mapstruct.ap.internal.conversion.SimpleConversion
- All Implemented Interfaces:
ConversionProvider
- Direct Known Subclasses:
AbstractJavaTimeToStringConversion,AbstractJodaTypeToStringConversion,AbstractNumberToStringConversion,BigDecimalToBigIntegerConversion,BigDecimalToPrimitiveConversion,BigDecimalToWrapperConversion,BigIntegerToPrimitiveConversion,BigIntegerToWrapperConversion,CharToStringConversion,CharWrapperToStringConversion,CurrencyToStringConversion,DateToSqlDateConversion,DateToSqlTimeConversion,DateToSqlTimestampConversion,EnumStringConversion,EnumToIntegerConversion,JavaInstantToDateConversion,JavaLocalDateTimeToDateConversion,JavaLocalDateTimeToLocalDateConversion,JavaLocalDateToDateConversion,JavaLocalDateToSqlDateConversion,JavaZonedDateTimeToDateConversion,JodaDateTimeToCalendarConversion,JodaTimeToDateConversion,LocaleToStringConversion,PrimitiveToPrimitiveConversion,PrimitiveToWrapperConversion,StaticParseToStringConversion,StringBuilderToStringConversion,TypeToOptionalConversion,URLToStringConversion,UUIDToStringConversion,WrapperToWrapperConversion
Base class for
ConversionProviders creating TypeConversions which don't declare any exception types.- Author:
- Gunnar Morling
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfrom(ConversionContext conversionContext) Creates the conversion from target to source of a property mapping.getFromConversionExceptionTypes(ConversionContext conversionContext) getFromConversionImportTypes(ConversionContext conversionContext) Returns a set with imported types of the "from" conversion.protected abstract StringgetFromExpression(ConversionContext conversionContext) Returns the conversion string from target to source.getRequiredHelperMethods(ConversionContext conversionContext) Retrieves any helper methods required for creating the conversion.getToConversionExceptionTypes(ConversionContext conversionContext) getToConversionImportTypes(ConversionContext conversionContext) Returns a set with imported types of the "to" conversion.protected abstract StringgetToExpression(ConversionContext conversionContext) Returns the conversion string from source to target.to(ConversionContext conversionContext) Creates the conversion from source to target of a property mapping.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.mapstruct.ap.internal.conversion.ConversionProvider
getRequiredHelperFields
-
Constructor Details
-
SimpleConversion
public SimpleConversion()
-
-
Method Details
-
to
Description copied from interface:ConversionProviderCreates the conversion from source to target of a property mapping.- Specified by:
toin interfaceConversionProvider- Parameters:
conversionContext- ConversionContext providing optional information required for creating the conversion.- Returns:
- A conversion from source to target.
-
from
Description copied from interface:ConversionProviderCreates the conversion from target to source of a property mapping.- Specified by:
fromin interfaceConversionProvider- Parameters:
conversionContext- ConversionContext providing optional information required for creating the conversion.- Returns:
- A conversion from target to source.
-
getRequiredHelperMethods
Description copied from interface:ConversionProviderRetrieves any helper methods required for creating the conversion.- Specified by:
getRequiredHelperMethodsin interfaceConversionProvider- Parameters:
conversionContext- ConversionContext providing optional information required for creating the conversion.- Returns:
- any helper methods when required.
-
getToExpression
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
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
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
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
-
getFromConversionExceptionTypes
-