
public class DefaultEnumMappingStrategy extends Object implements EnumMappingStrategy
| Modifier and Type | Field and Description |
|---|---|
protected Elements |
elementUtils |
protected Types |
typeUtils |
| Constructor and Description |
|---|
DefaultEnumMappingStrategy() |
| Modifier and Type | Method and Description |
|---|---|
String |
getDefaultNullEnumConstant(TypeElement enumType)
Return the default enum constant to use if the source is null.
|
String |
getEnumConstant(TypeElement enumType,
String enumConstant)
Map the enum constant to the value use for matching.
|
protected Class<? extends Exception> |
getUnexpectedValueMappingExceptionClass() |
TypeElement |
getUnexpectedValueMappingExceptionType()
Return the type element of the exception that should be used in the generated code
for an unexpected enum constant.
|
void |
init(MapStructProcessingEnvironment processingEnvironment)
Initializes the enum value mapping strategy
|
public void init(MapStructProcessingEnvironment processingEnvironment)
EnumMappingStrategyinit in interface EnumMappingStrategyprocessingEnvironment - environment for facilitiespublic String getDefaultNullEnumConstant(TypeElement enumType)
EnumMappingStrategygetDefaultNullEnumConstant in interface EnumMappingStrategyenumType - the enumpublic String getEnumConstant(TypeElement enumType, String enumConstant)
EnumMappingStrategyMappingConstants.NULLgetEnumConstant in interface EnumMappingStrategyenumType - the enum this constant belongs toenumConstant - constant to transformpublic TypeElement getUnexpectedValueMappingExceptionType()
EnumMappingStrategygetUnexpectedValueMappingExceptionType in interface EnumMappingStrategynullCopyright © 2012-2021 MapStruct Authors; All rights reserved. Released under the Apache Software License 2.0.