Class AbstractJodaTypeToStringConversion
- java.lang.Object
-
- org.mapstruct.ap.internal.conversion.SimpleConversion
-
- org.mapstruct.ap.internal.conversion.AbstractJodaTypeToStringConversion
-
- All Implemented Interfaces:
ConversionProvider
- Direct Known Subclasses:
JodaDateTimeToStringConversion,JodaLocalDateTimeToStringConversion,JodaLocalDateToStringConversion,JodaLocalTimeToStringConversion
public abstract class AbstractJodaTypeToStringConversion extends SimpleConversion
Base class for conversions between Joda-Time types and String.
-
-
Constructor Summary
Constructors Constructor Description AbstractJodaTypeToStringConversion()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private java.lang.StringconversionString(ConversionContext conversionContext, java.lang.String method)private java.lang.StringdateFormatPattern(ConversionContext conversionContext)private java.lang.StringdefaultDateFormatPattern(ConversionContext conversionContext)protected abstract java.lang.StringformatStyle()protected java.util.Set<Type>getFromConversionImportTypes(ConversionContext conversionContext)Returns a set with imported types of the "from" conversion.protected java.lang.StringgetFromExpression(ConversionContext conversionContext)Returns the conversion string from target to source.protected java.util.Set<Type>getToConversionImportTypes(ConversionContext conversionContext)Returns a set with imported types of the "to" conversion.protected java.lang.StringgetToExpression(ConversionContext conversionContext)Returns the conversion string from source to target.protected abstract java.lang.StringparseMethod()-
Methods inherited from class org.mapstruct.ap.internal.conversion.SimpleConversion
from, getFromConversionExceptionTypes, getRequiredHelperMethods, getToConversionExceptionTypes, to
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.mapstruct.ap.internal.conversion.ConversionProvider
getRequiredHelperFields
-
-
-
-
Method Detail
-
getToExpression
protected java.lang.String getToExpression(ConversionContext conversionContext)
Description copied from class:SimpleConversionReturns the conversion string from source to target. The placeholder<SOURCE>can be used to represent a reference to the source value.- Specified by:
getToExpressionin classSimpleConversion- Parameters:
conversionContext- A context providing optional information required for creating the conversion.- Returns:
- The conversion string from source to target
-
getToConversionImportTypes
protected java.util.Set<Type> getToConversionImportTypes(ConversionContext conversionContext)
Description copied from class:SimpleConversionReturns 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.- Overrides:
getToConversionImportTypesin classSimpleConversion- Parameters:
conversionContext- the conversion context- Returns:
- conversion types required in the "to" conversion
-
getFromExpression
protected java.lang.String getFromExpression(ConversionContext conversionContext)
Description copied from class:SimpleConversionReturns the conversion string from target to source. The placeholder<SOURCE>can be used to represent a reference to the target value.- Specified by:
getFromExpressionin classSimpleConversion- Parameters:
conversionContext- ConversionContext providing optional information required for creating the conversion.- Returns:
- The conversion string from target to source
-
getFromConversionImportTypes
protected java.util.Set<Type> getFromConversionImportTypes(ConversionContext conversionContext)
Description copied from class:SimpleConversionReturns 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.- Overrides:
getFromConversionImportTypesin classSimpleConversion- Parameters:
conversionContext- the conversion context- Returns:
- conversion types required in the "from" conversion
-
conversionString
private java.lang.String conversionString(ConversionContext conversionContext, java.lang.String method)
-
dateFormatPattern
private java.lang.String dateFormatPattern(ConversionContext conversionContext)
-
defaultDateFormatPattern
private java.lang.String defaultDateFormatPattern(ConversionContext conversionContext)
-
formatStyle
protected abstract java.lang.String formatStyle()
- Returns:
- the default format style to be applied if non is given explicitly.
-
parseMethod
protected abstract java.lang.String parseMethod()
- Returns:
- the name of the parse method for converting a String into a specific Joda-Time type.
-
-