Class ControllerGenerator
java.lang.Object
nl.datasteel.crudcraft.codegen.writer.stubs.ControllerGenerator
- All Implemented Interfaces:
Generator
,StubGenerator
Generates REST controllers directly from templates without relying on an abstract base class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.squareup.javapoet.JavaFile
build
(ModelDescriptor modelDescriptor, WriteContext ctx) Build the JavaFile representing the stub.int
order()
Determines the execution order within the generator group (basic or CRUD).boolean
Indicates whether this generator should only be applied to models that are marked as CrudCraft entities.void
write
(ModelDescriptor modelDescriptor, WriteContext ctx) Writes the generated stub files to the context.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nl.datasteel.crudcraft.codegen.writer.stubs.StubGenerator
generate
-
Constructor Details
-
ControllerGenerator
public ControllerGenerator()
-
-
Method Details
-
build
Description copied from interface:StubGenerator
Build the JavaFile representing the stub.- Specified by:
build
in interfaceStubGenerator
-
write
Description copied from interface:StubGenerator
Writes the generated stub files to the context. Editable stubs are written just like non-editable ones; a subsequent tooling step will decide whether to keep or copy them into the user's source tree.- Specified by:
write
in interfaceGenerator
- Specified by:
write
in interfaceStubGenerator
- Parameters:
modelDescriptor
- the model descriptor to generate code forctx
- shared write context
-
requiresCrudEntity
public boolean requiresCrudEntity()Description copied from interface:Generator
Indicates whether this generator should only be applied to models that are marked as CrudCraft entities. Generators returningtrue
are executed only when the model descriptor reportsModelDescriptor.isCrudCraftEntity()
astrue
.- Specified by:
requiresCrudEntity
in interfaceGenerator
- Returns:
true
if the generator requires a CrudCraft entity
-
order
public int order()Description copied from interface:Generator
Determines the execution order within the generator group (basic or CRUD). Lower values run first.
-