Package org.mapstruct.ap.internal.model
Class GeneratedType
- java.lang.Object
-
- org.mapstruct.ap.internal.writer.FreeMarkerWritable
-
- org.mapstruct.ap.internal.model.common.ModelElement
-
- org.mapstruct.ap.internal.model.GeneratedType
-
- All Implemented Interfaces:
Writable
public abstract class GeneratedType extends ModelElement
A type generated by MapStruct, e.g. representing a mapper type.- Author:
- Gunnar Morling
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
GeneratedType.GeneratedTypeBuilder<T extends GeneratedType.GeneratedTypeBuilder>
-
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
GeneratedType(TypeFactory typeFactory, String packageName, String name, Type mapperDefinitionType, List<MappingMethod> methods, List<Field> fields, Options options, VersionInformation versionInformation, boolean suppressGeneratorTimestamp, Accessibility accessibility, SortedSet<Type> extraImportedTypes, Constructor constructor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAnnotation(Annotation annotation)
protected void
addIfImportRequired(Collection<Type> collection, Type typeToAdd)
Accessibility
getAccessibility()
List<Annotation>
getAnnotations()
Constructor
getConstructor()
List<Field>
getFields()
SortedSet<String>
getImportTypeNames()
SortedSet<Type>
getImportTypes()
Returns a set containing thoseType
s referenced by this model element for which an import statement needs to be declared.Javadoc
getJavadoc()
Type
getMapperDefinitionType()
List<GeneratedTypeMethod>
getMethods()
String
getName()
String
getPackageName()
VersionInformation
getVersionInformation()
boolean
hasPackageName()
boolean
isGeneratedTypeAvailable()
boolean
isSuppressGeneratorTimestamp()
boolean
isSuppressGeneratorVersionComment()
void
removeConstructor()
void
setConstructor(Constructor constructor)
void
setFields(List<Field> fields)
-
Methods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateName, getTemplateNameForClass, write
-
-
-
-
Constructor Detail
-
GeneratedType
protected GeneratedType(TypeFactory typeFactory, String packageName, String name, Type mapperDefinitionType, List<MappingMethod> methods, List<Field> fields, Options options, VersionInformation versionInformation, boolean suppressGeneratorTimestamp, Accessibility accessibility, SortedSet<Type> extraImportedTypes, Constructor constructor)
-
-
Method Detail
-
getPackageName
public String getPackageName()
-
hasPackageName
public boolean hasPackageName()
-
getName
public String getName()
-
getMapperDefinitionType
public Type getMapperDefinitionType()
-
getAnnotations
public List<Annotation> getAnnotations()
-
addAnnotation
public void addAnnotation(Annotation annotation)
-
getMethods
public List<GeneratedTypeMethod> getMethods()
-
isSuppressGeneratorTimestamp
public boolean isSuppressGeneratorTimestamp()
-
isSuppressGeneratorVersionComment
public boolean isSuppressGeneratorVersionComment()
-
isGeneratedTypeAvailable
public boolean isGeneratedTypeAvailable()
-
getVersionInformation
public VersionInformation getVersionInformation()
-
getAccessibility
public Accessibility getAccessibility()
-
setConstructor
public void setConstructor(Constructor constructor)
-
getImportTypes
public SortedSet<Type> getImportTypes()
Description copied from class:ModelElement
Returns a set containing thoseType
s referenced by this model element for which an import statement needs to be declared.- Specified by:
getImportTypes
in classModelElement
- Returns:
- A set with type referenced by this model element. Must not be
null
.
-
getConstructor
public Constructor getConstructor()
-
removeConstructor
public void removeConstructor()
-
getJavadoc
public Javadoc getJavadoc()
-
addIfImportRequired
protected void addIfImportRequired(Collection<Type> collection, Type typeToAdd)
-
-