Class MapperGenerator
java.lang.Object
nl.datasteel.crudcraft.codegen.writer.stubs.MapperGenerator
- All Implemented Interfaces:
Generator,StubGenerator
Generates a MapStruct mapper interface for the given model descriptor,
inclusief automatisch invullen van 'uses = { ...Mapper.class }' voor
alle @ManyToOne, @OneToMany, @ManyToMany, etc. relaties.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.squareup.javapoet.JavaFilebuild(ModelDescriptor modelDescriptor, WriteContext ctx) Generates the mapper interface for the given model descriptor.intorder()Determines the execution order within the generator group (basic or CRUD).booleanIndicates whether this generator should only be applied to models that are marked as CrudCraft entities.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nl.datasteel.crudcraft.codegen.writer.stubs.StubGenerator
generate, write
-
Constructor Details
-
MapperGenerator
public MapperGenerator()
-
-
Method Details
-
build
Generates the mapper interface for the given model descriptor. This method creates a MapStruct mapper interface with the necessary annotations and type parameters.- Specified by:
buildin interfaceStubGenerator- Parameters:
modelDescriptor- the model descriptor containing metadata about the entityctx- shared write context- Returns:
- a JavaFile representing the generated mapper interface
-
requiresCrudEntity
public boolean requiresCrudEntity()Description copied from interface:GeneratorIndicates whether this generator should only be applied to models that are marked as CrudCraft entities. Generators returningtrueare executed only when the model descriptor reportsModelDescriptor.isCrudCraftEntity()astrue.- Specified by:
requiresCrudEntityin interfaceGenerator- Returns:
trueif the generator requires a CrudCraft entity
-
order
public int order()Description copied from interface:GeneratorDetermines the execution order within the generator group (basic or CRUD). Lower values run first.
-