Package org.mapstruct.ap.internal.model
Class Mapper
- java.lang.Object
-
- org.mapstruct.ap.internal.writer.FreeMarkerWritable
-
- org.mapstruct.ap.internal.model.common.ModelElement
-
- org.mapstruct.ap.internal.model.GeneratedType
-
- org.mapstruct.ap.internal.model.Mapper
-
- All Implemented Interfaces:
Writable
public class Mapper extends GeneratedType
Represents a type implementing a mapper interface (annotated with@Mapper). This is the root object of the mapper model.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMapper.Builder-
Nested classes/interfaces inherited from class org.mapstruct.ap.internal.model.GeneratedType
GeneratedType.GeneratedTypeBuilder<T extends GeneratedType.GeneratedTypeBuilder>
-
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.StringCLASS_NAME_PLACEHOLDERprivate booleancustomImplNameprivate booleancustomPackageprivate Decoratordecorator(package private) static java.lang.StringDEFAULT_IMPLEMENTATION_CLASS(package private) static java.lang.StringDEFAULT_IMPLEMENTATION_PACKAGE(package private) static java.lang.StringPACKAGE_NAME_PLACEHOLDER
-
Constructor Summary
Constructors Modifier Constructor Description privateMapper(TypeFactory typeFactory, java.lang.String packageName, java.lang.String name, Type mapperDefinitionType, boolean customPackage, boolean customImplName, java.util.List<MappingMethod> methods, Options options, VersionInformation versionInformation, boolean suppressGeneratorTimestamp, Accessibility accessibility, java.util.List<Field> fields, Constructor constructor, Decorator decorator, java.util.SortedSet<Type> extraImportedTypes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DecoratorgetDecorator()static java.lang.StringgetFlatName(javax.lang.model.element.TypeElement element)Returns the same asClass.getName()but without the package declaration.protected java.lang.StringgetTemplateName()Returns the name of the template to be used for a specific writable type.booleanhasCustomImplementation()voidremoveDecorator()-
Methods inherited from class org.mapstruct.ap.internal.model.GeneratedType
addAnnotation, addIfImportRequired, getAccessibility, getAnnotations, getConstructor, getFields, getImportTypeNames, getImportTypes, getMapperDefinitionType, getMethods, getName, getPackageName, getVersionInformation, hasPackageName, isGeneratedTypeAvailable, isSuppressGeneratorTimestamp, isSuppressGeneratorVersionComment, removeConstructor, setConstructor, setFields
-
Methods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateNameForClass, write
-
-
-
-
Field Detail
-
CLASS_NAME_PLACEHOLDER
static final java.lang.String CLASS_NAME_PLACEHOLDER
- See Also:
- Constant Field Values
-
PACKAGE_NAME_PLACEHOLDER
static final java.lang.String PACKAGE_NAME_PLACEHOLDER
- See Also:
- Constant Field Values
-
DEFAULT_IMPLEMENTATION_CLASS
static final java.lang.String DEFAULT_IMPLEMENTATION_CLASS
- See Also:
- Constant Field Values
-
DEFAULT_IMPLEMENTATION_PACKAGE
static final java.lang.String DEFAULT_IMPLEMENTATION_PACKAGE
- See Also:
- Constant Field Values
-
customPackage
private final boolean customPackage
-
customImplName
private final boolean customImplName
-
decorator
private Decorator decorator
-
-
Constructor Detail
-
Mapper
private Mapper(TypeFactory typeFactory, java.lang.String packageName, java.lang.String name, Type mapperDefinitionType, boolean customPackage, boolean customImplName, java.util.List<MappingMethod> methods, Options options, VersionInformation versionInformation, boolean suppressGeneratorTimestamp, Accessibility accessibility, java.util.List<Field> fields, Constructor constructor, Decorator decorator, java.util.SortedSet<Type> extraImportedTypes)
-
-
Method Detail
-
getDecorator
public Decorator getDecorator()
-
removeDecorator
public void removeDecorator()
-
hasCustomImplementation
public boolean hasCustomImplementation()
-
getTemplateName
protected java.lang.String getTemplateName()
Description copied from class:FreeMarkerWritableReturns the name of the template to be used for a specific writable type. By default,FreeMarkerWritable.getTemplateNameForClass(Class)is called withgetClass(), but this can be customized by overriding this method if required.- Overrides:
getTemplateNamein classFreeMarkerWritable- Returns:
- the name of the template. Must not be
null.
-
getFlatName
public static java.lang.String getFlatName(javax.lang.model.element.TypeElement element)
Returns the same asClass.getName()but without the package declaration.- Parameters:
element- the element that should be flattened- Returns:
- the flat name for the type element
-
-