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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classGeneratedType.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 private Accessibilityaccessibilityprivate java.util.List<Annotation>annotationsprivate Constructorconstructorprivate java.util.SortedSet<Type>extraImportedTypesprivate java.util.List<Field>fieldsprivate TypegeneratedTypeType representing the@Generatedannotationprivate booleangeneratedTypeAvailableprivate static java.lang.StringJAVA_LANG_PACKAGEprivate TypemapperDefinitionTypeprivate java.util.List<MappingMethod>methodsprivate java.lang.Stringnameprivate java.lang.StringpackageNameprivate booleansuppressGeneratorTimestampprivate booleansuppressGeneratorVersionCommentprivate VersionInformationversionInformation
-
Constructor Summary
Constructors Modifier Constructor Description protectedGeneratedType(TypeFactory typeFactory, java.lang.String packageName, java.lang.String name, Type mapperDefinitionType, java.util.List<MappingMethod> methods, java.util.List<Field> fields, Options options, VersionInformation versionInformation, boolean suppressGeneratorTimestamp, Accessibility accessibility, java.util.SortedSet<Type> extraImportedTypes, Constructor constructor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAnnotation(Annotation annotation)protected voidaddIfImportRequired(java.util.Collection<Type> collection, Type typeToAdd)AccessibilitygetAccessibility()java.util.List<Annotation>getAnnotations()ConstructorgetConstructor()java.util.List<Field>getFields()java.util.SortedSet<java.lang.String>getImportTypeNames()java.util.SortedSet<Type>getImportTypes()Returns a set containing thoseTypes referenced by this model element for which an import statement needs to be declared.TypegetMapperDefinitionType()java.util.List<MappingMethod>getMethods()java.lang.StringgetName()java.lang.StringgetPackageName()VersionInformationgetVersionInformation()booleanhasPackageName()booleanisGeneratedTypeAvailable()booleanisSuppressGeneratorTimestamp()booleanisSuppressGeneratorVersionComment()private booleanneedsImportDeclaration(Type typeToAdd)voidremoveConstructor()voidsetConstructor(Constructor constructor)voidsetFields(java.util.List<Field> fields)-
Methods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateName, getTemplateNameForClass, write
-
-
-
-
Field Detail
-
JAVA_LANG_PACKAGE
private static final java.lang.String JAVA_LANG_PACKAGE
- See Also:
- Constant Field Values
-
packageName
private final java.lang.String packageName
-
name
private final java.lang.String name
-
mapperDefinitionType
private final Type mapperDefinitionType
-
annotations
private final java.util.List<Annotation> annotations
-
methods
private final java.util.List<MappingMethod> methods
-
extraImportedTypes
private final java.util.SortedSet<Type> extraImportedTypes
-
suppressGeneratorTimestamp
private final boolean suppressGeneratorTimestamp
-
suppressGeneratorVersionComment
private final boolean suppressGeneratorVersionComment
-
versionInformation
private final VersionInformation versionInformation
-
accessibility
private final Accessibility accessibility
-
fields
private java.util.List<Field> fields
-
constructor
private Constructor constructor
-
generatedType
private final Type generatedType
Type representing the@Generatedannotation
-
generatedTypeAvailable
private final boolean generatedTypeAvailable
-
-
Constructor Detail
-
GeneratedType
protected GeneratedType(TypeFactory typeFactory, java.lang.String packageName, java.lang.String name, Type mapperDefinitionType, java.util.List<MappingMethod> methods, java.util.List<Field> fields, Options options, VersionInformation versionInformation, boolean suppressGeneratorTimestamp, Accessibility accessibility, java.util.SortedSet<Type> extraImportedTypes, Constructor constructor)
-
-
Method Detail
-
getPackageName
public java.lang.String getPackageName()
-
hasPackageName
public boolean hasPackageName()
-
getName
public java.lang.String getName()
-
getMapperDefinitionType
public Type getMapperDefinitionType()
-
getAnnotations
public java.util.List<Annotation> getAnnotations()
-
addAnnotation
public void addAnnotation(Annotation annotation)
-
getMethods
public java.util.List<MappingMethod> getMethods()
-
getFields
public java.util.List<Field> getFields()
-
setFields
public void setFields(java.util.List<Field> fields)
-
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 java.util.SortedSet<Type> getImportTypes()
Description copied from class:ModelElementReturns a set containing thoseTypes referenced by this model element for which an import statement needs to be declared.- Specified by:
getImportTypesin classModelElement- Returns:
- A set with type referenced by this model element. Must not be
null.
-
getImportTypeNames
public java.util.SortedSet<java.lang.String> getImportTypeNames()
-
getConstructor
public Constructor getConstructor()
-
removeConstructor
public void removeConstructor()
-
addIfImportRequired
protected void addIfImportRequired(java.util.Collection<Type> collection, Type typeToAdd)
-
needsImportDeclaration
private boolean needsImportDeclaration(Type typeToAdd)
-
-