Class AbstractFileHeader

java.lang.Object
nl.datasteel.crudcraft.codegen.fileheader.AbstractFileHeader
Direct Known Subclasses:
LogicEditableHeader, LogicStrictHeader, ModelEditableHeader, ModelStrictHeader, SearchEditableHeader, SearchStrictHeader

public abstract class AbstractFileHeader extends Object
Base utilities for generating CrudCraft file headers.
  • Field Details

    • MARKER_GENERATED

      public static final String MARKER_GENERATED
      Marker indicating that the file was generated by CrudCraft.
      See Also:
    • MARKER_EDITABLE

      public static final String 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

      protected static final String 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

      protected static final String 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 class
      pkg - the package name
      generatorClass - 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 class
      pkg - the package name
      generatorClass - the name of the generator class
      extraParagraph - 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 class
      pkg - the package name
      generatorClass - the name of the generator class
      extraParagraph - additional information to include in the header
      features - features provided by CrudCraft for this layer
      Returns:
      a formatted header string
    • strictHeader

      protected static String strictHeader(String modelClass, String pkg, String generatorClass)
      Generates a strict header for model classes that should not be edited.
      Parameters:
      modelClass - the name of the model class
      pkg - the package name
      generatorClass - 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 class
      pkg - the package name
      generatorClass - the name of the generator class
      extraParagraph - 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 class
      pkg - the package name
      generatorClass - the name of the generator class
      extraParagraph - additional information to include in the header
      features - features provided by CrudCraft for this model
      Returns:
      a formatted header string