public abstract class AnnotationBasedComponentModelProcessor extends Object implements ModelElementProcessor<Mapper,Mapper>
ModelElementProcessor
which converts the given Mapper
object into an annotation based component
model in case a matching model is selected as target component model for this mapper.ModelElementProcessor.ProcessorContext
Constructor and Description |
---|
AnnotationBasedComponentModelProcessor() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
additionalPublicEmptyConstructor() |
protected void |
adjustDecorator(Mapper mapper,
org.mapstruct.ap.internal.gem.InjectionStrategyGem injectionStrategy) |
protected abstract String |
getComponentModelIdentifier() |
protected List<Annotation> |
getDecoratorAnnotations() |
protected List<Annotation> |
getDelegatorReferenceAnnotations(Mapper mapper) |
protected abstract List<Annotation> |
getMapperReferenceAnnotations() |
int |
getPriority()
Returns the priority value of this processor which must be between 1
(highest priority) and 10000 (lowest priority).
|
protected abstract List<Annotation> |
getTypeAnnotations(Mapper mapper) |
protected TypeFactory |
getTypeFactory() |
Mapper |
process(ModelElementProcessor.ProcessorContext context,
TypeElement mapperTypeElement,
Mapper mapper)
Processes the given source element, representing a Java bean mapper in
one form or another.
|
protected Field |
replacementMapperReference(Field originalReference,
List<Annotation> annotations,
org.mapstruct.ap.internal.gem.InjectionStrategyGem injectionStrategy) |
protected abstract boolean |
requiresGenerationOfDecoratorClass() |
public AnnotationBasedComponentModelProcessor()
public Mapper process(ModelElementProcessor.ProcessorContext context, TypeElement mapperTypeElement, Mapper mapper)
ModelElementProcessor
process
in interface ModelElementProcessor<Mapper,Mapper>
context
- Context providing common infrastructure objects.mapperTypeElement
- The original type element from which the given mapper object
is derived.mapper
- The current representation of the bean mapper. Never
null
(the very first processor receives the original
type element).null
except for the very last processor which
generates the resulting Java source file.protected void adjustDecorator(Mapper mapper, org.mapstruct.ap.internal.gem.InjectionStrategyGem injectionStrategy)
protected boolean additionalPublicEmptyConstructor()
protected List<Annotation> getDelegatorReferenceAnnotations(Mapper mapper)
protected Field replacementMapperReference(Field originalReference, List<Annotation> annotations, org.mapstruct.ap.internal.gem.InjectionStrategyGem injectionStrategy)
originalReference
- the reference to be replacedannotations
- the list of annotationsinjectionStrategy
- strategy for injectionprotected abstract String getComponentModelIdentifier()
protected abstract List<Annotation> getTypeAnnotations(Mapper mapper)
mapper
- the mapperprotected List<Annotation> getDecoratorAnnotations()
protected abstract List<Annotation> getMapperReferenceAnnotations()
protected abstract boolean requiresGenerationOfDecoratorClass()
public int getPriority()
ModelElementProcessor
Mapper
model must have a priority > 1000.getPriority
in interface ModelElementProcessor<Mapper,Mapper>
protected TypeFactory getTypeFactory()
Copyright © 2012-2021 MapStruct Authors; All rights reserved. Released under the Apache Software License 2.0.