Package org.mapstruct.ap.internal.model
Class AnnotationMapperReference
- java.lang.Object
-
- org.mapstruct.ap.internal.writer.FreeMarkerWritable
-
- org.mapstruct.ap.internal.model.common.ModelElement
-
- org.mapstruct.ap.internal.model.Field
-
- org.mapstruct.ap.internal.model.MapperReference
-
- org.mapstruct.ap.internal.model.AnnotationMapperReference
-
- All Implemented Interfaces:
Writable
public class AnnotationMapperReference extends MapperReference
Mapper reference which is retrieved via Annotation-based dependency injection.
The dependency injection may vary between field and constructor injection. Thus, it is possible to define, whether to include annotations on the field.- Author:
- Gunnar Morling, Andreas Gudian, Kevin Grüneberg
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context
-
-
Constructor Summary
Constructors Constructor Description AnnotationMapperReference(Type type, String variableName, List<Annotation> annotations, boolean isUsed, boolean fieldFinal, boolean includeAnnotationsOnField)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Annotation>
getAnnotations()
Set<Type>
getImportTypes()
Returns a set containing thoseType
s referenced by this model element for which an import statement needs to be declared.boolean
isFieldFinal()
boolean
isIncludeAnnotationsOnField()
AnnotationMapperReference
withNewAnnotations(List<Annotation> annotations)
-
Methods inherited from class org.mapstruct.ap.internal.model.MapperReference
findMapperReference
-
Methods inherited from class org.mapstruct.ap.internal.model.Field
equals, getFieldNames, getType, getVariableName, hashCode, isTypeRequiresImport, isUsed, setTypeRequiresImport, setUsed
-
Methods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateName, getTemplateNameForClass, write
-
-
-
-
Constructor Detail
-
AnnotationMapperReference
public AnnotationMapperReference(Type type, String variableName, List<Annotation> annotations, boolean isUsed, boolean fieldFinal, boolean includeAnnotationsOnField)
-
-
Method Detail
-
getAnnotations
public List<Annotation> getAnnotations()
-
getImportTypes
public Set<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.- Overrides:
getImportTypes
in classField
- Returns:
- A set with type referenced by this model element. Must not be
null
.
-
isFieldFinal
public boolean isFieldFinal()
-
isIncludeAnnotationsOnField
public boolean isIncludeAnnotationsOnField()
-
withNewAnnotations
public AnnotationMapperReference withNewAnnotations(List<Annotation> annotations)
-
-