Class AbstractFileHeader
java.lang.Object
nl.datasteel.crudcraft.codegen.fileheader.AbstractFileHeader
- Direct Known Subclasses:
LogicEditableHeader
,LogicStrictHeader
,ModelEditableHeader
,ModelStrictHeader
,SearchEditableHeader
,SearchStrictHeader
Base utilities for generating CrudCraft file headers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Marker indicating that the file is editable.static final String
Marker indicating that the file was generated by CrudCraft.protected static final String
Timestamp of when the file was generated, formatted in ISO 8601.protected static final String
Version of CrudCraft used to generate the file. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Private constructor to prevent instantiation of this utility class. -
Method Summary
Modifier and TypeMethodDescriptionprotected static String
editableHeader
(String layerType, String modelClass, String pkg, String generatorClass) Generates a header for editable files in the specified layer.protected static String
editableHeader
(String layerType, String modelClass, String pkg, String generatorClass, String extraParagraph) Generates a header for editable files in the specified layer with an extra paragraph.protected static String
editableHeader
(String layerType, String modelClass, String pkg, String generatorClass, String extraParagraph, String features) Generates a header for editable files in the specified layer with an extra paragraph and features.protected static String
strictHeader
(String modelClass, String pkg, String generatorClass) Generates a strict header for model classes that should not be edited.protected static String
strictHeader
(String modelClass, String pkg, String generatorClass, String extraParagraph) Generates a strict header for model classes that should not be edited, with an extra paragraph.protected static String
strictHeader
(String modelClass, String pkg, String generatorClass, String extraParagraph, String features) Generates a strict header for model classes that should not be edited, with an extra paragraph and features.
-
Field Details
-
MARKER_GENERATED
Marker indicating that the file was generated by CrudCraft.- See Also:
-
MARKER_EDITABLE
Marker indicating that the file is editable. This is used to differentiate between files that can be modified and those that should not be edited manually.- See Also:
-
TIMESTAMP
Timestamp of when the file was generated, formatted in ISO 8601. This is used to provide context about when the file was created. -
VERSION
Version of CrudCraft used to generate the file.
-
-
Constructor Details
-
AbstractFileHeader
protected AbstractFileHeader()Private constructor to prevent instantiation of this utility class. This class is intended to be extended, not instantiated directly.
-
-
Method Details
-
editableHeader
protected static String editableHeader(String layerType, String modelClass, String pkg, String generatorClass) Generates a header for editable files in the specified layer.- Parameters:
layerType
- the type of layer (e.g., "Controller", "Service")modelClass
- the name of the model classpkg
- the package namegeneratorClass
- the name of the generator class- Returns:
- a formatted header string
-
editableHeader
protected static String editableHeader(String layerType, String modelClass, String pkg, String generatorClass, String extraParagraph) Generates a header for editable files in the specified layer with an extra paragraph.- Parameters:
layerType
- the type of layer (e.g., "Controller", "Service")modelClass
- the name of the model classpkg
- the package namegeneratorClass
- the name of the generator classextraParagraph
- additional information to include in the header- Returns:
- a formatted header string
-
editableHeader
protected static String editableHeader(String layerType, String modelClass, String pkg, String generatorClass, String extraParagraph, String features) Generates a header for editable files in the specified layer with an extra paragraph and features.- Parameters:
layerType
- the type of layer (e.g., "Controller", "Service")modelClass
- the name of the model classpkg
- the package namegeneratorClass
- the name of the generator classextraParagraph
- additional information to include in the headerfeatures
- features provided by CrudCraft for this layer- Returns:
- a formatted header string
-
strictHeader
Generates a strict header for model classes that should not be edited.- Parameters:
modelClass
- the name of the model classpkg
- the package namegeneratorClass
- the name of the generator class- Returns:
- a formatted header string
-
strictHeader
protected static String strictHeader(String modelClass, String pkg, String generatorClass, String extraParagraph) Generates a strict header for model classes that should not be edited, with an extra paragraph.- Parameters:
modelClass
- the name of the model classpkg
- the package namegeneratorClass
- the name of the generator classextraParagraph
- additional information to include in the header- Returns:
- a formatted header string
-
strictHeader
protected static String strictHeader(String modelClass, String pkg, String generatorClass, String extraParagraph, String features) Generates a strict header for model classes that should not be edited, with an extra paragraph and features.- Parameters:
modelClass
- the name of the model classpkg
- the package namegeneratorClass
- the name of the generator classextraParagraph
- additional information to include in the headerfeatures
- features provided by CrudCraft for this model- Returns:
- a formatted header string
-