Class ProjectProcessor

java.lang.Object
org.machanism.machai.project.ProjectProcessor

public abstract class ProjectProcessor extends Object
Abstract base class for processing project structures and modules.

Handles project folder scanning and delegates module or folder-specific processing to subclasses.

Usage Example:


   ProjectProcessor processor = ...;
   processor.scanFolder(new File("/path/to/project"));
 
Since:
0.0.2
Author:
Viktor Tovstyi
  • Field Details

    • MACHAI_TEMP_DIR

      public static final String MACHAI_TEMP_DIR
      Name of the directory holding temporary documentation inputs.
      See Also:
  • Constructor Details

    • ProjectProcessor

      public ProjectProcessor()
  • Method Details

    • scanFolder

      public void scanFolder(File projectDir) throws IOException
      Scans the main project directory, detects modules, and processes them. If modules are present, each module is processed. Otherwise, the entire folder structure is processed.
      Parameters:
      projectDir - The root project directory to scan.
      Throws:
      IOException - If an error occurs reading folders or files.
    • processModule

      protected void processModule(File projectDir, String module) throws IOException
      Processes a given project module by recursively scanning.
      Parameters:
      projectDir - The main project directory.
      module - The module name to process.
      Throws:
      IOException - If an error occurs during processing.
    • processFolder

      public abstract void processFolder(ProjectLayout processor)
      Processes a project folder layout. Must be implemented by subclasses to define custom logic.
      Parameters:
      processor - The ProjectLayout object representing the folder structure to process.
    • getProjectLayout

      public ProjectLayout getProjectLayout(File projectDir) throws FileNotFoundException
      Returns the detected ProjectLayout for the specified project directory.
      Parameters:
      projectDir - The root project directory to analyze.
      Returns:
      Detected ProjectLayout.
      Throws:
      FileNotFoundException - If the directory does not exist.