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 theConversionContext
passed 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 String
getDateFormat()
Returns the date format if this conversion or built-in method is from String to a date type (e.g.protected FormattingMessager
getMessager()
String
getNumberFormat()
Type
getTargetType()
Returns the target type of this conversion.TypeFactory
getTypeFactory()
-
-
-
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:ConversionContext
Returns the target type of this conversion.- Specified by:
getTargetType
in interfaceConversionContext
- Returns:
- The target type of this conversion.
-
getNumberFormat
public String getNumberFormat()
- Specified by:
getNumberFormat
in interfaceConversionContext
-
getDateFormat
public String getDateFormat()
Description copied from interface:ConversionContext
Returns 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:
getDateFormat
in interfaceConversionContext
- Returns:
- The date format if this conversion or built-in method is from String to a date type.
null
is returned for other types or if not given.
-
getTypeFactory
public TypeFactory getTypeFactory()
- Specified by:
getTypeFactory
in interfaceConversionContext
-
getMessager
protected FormattingMessager getMessager()
-
-