Class DefaultConversionContext
- java.lang.Object
-
- org.mapstruct.ap.internal.model.common.DefaultConversionContext
-
- All Implemented Interfaces:
ConversionContext
public class DefaultConversionContext extends Object implements ConversionContext
Default implementation of theConversionContextpassed to conversion providers.- Author:
- Gunnar Morling
-
-
Constructor Summary
Constructors Constructor Description DefaultConversionContext(TypeFactory typeFactory, FormattingMessager messager, Type sourceType, Type targetType, FormattingParameters formattingParameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDateFormat()Returns the date format if this conversion or built-in method is from String to a date type (e.g.protected FormattingMessagergetMessager()StringgetNumberFormat()TypegetTargetType()Returns the target type of this conversion.TypeFactorygetTypeFactory()
-
-
-
Constructor Detail
-
DefaultConversionContext
public DefaultConversionContext(TypeFactory typeFactory, FormattingMessager messager, Type sourceType, Type targetType, FormattingParameters formattingParameters)
-
-
Method Detail
-
getTargetType
public Type getTargetType()
Description copied from interface:ConversionContextReturns the target type of this conversion.- Specified by:
getTargetTypein interfaceConversionContext- Returns:
- The target type of this conversion.
-
getNumberFormat
public String getNumberFormat()
- Specified by:
getNumberFormatin interfaceConversionContext
-
getDateFormat
public String getDateFormat()
Description copied from interface:ConversionContextReturns the date format if this conversion or built-in method is from String to a date type (e.g.Date) or vice versa.- Specified by:
getDateFormatin interfaceConversionContext- Returns:
- The date format if this conversion or built-in method is from String to a date type.
nullis returned for other types or if not given.
-
getTypeFactory
public TypeFactory getTypeFactory()
- Specified by:
getTypeFactoryin interfaceConversionContext
-
getMessager
protected FormattingMessager getMessager()
-
-