Package org.machanism.machai.gw
Class FileProcessor
java.lang.Object
org.machanism.machai.project.ProjectProcessor
org.machanism.machai.gw.FileProcessor
public class FileProcessor
extends org.machanism.machai.project.ProjectProcessor
Processor for project documentation generation.
Scans project sources, applies file reviewers for extracting documentation guidance, and orchestrates the input preparation for large language model document generation.
Example usage:
GenAIProvider provider = ...; // Obtain your provider
FileProcessor processor = new FileProcessor(provider);
processor.scanDocuments(new File("/path/to/project"));
The processor coordinates reviewers for supported file types and prepares the document inputs according to best practice guidance.
All public and protected methods and fields are documented as per package guidance.
- Since:
- 0.0.2
- Author:
- Viktor Tovstyi
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFileProcessor(org.machanism.machai.ai.manager.GenAIProvider provider) Constructs a FileProcessor for documentation input preparation. -
Method Summary
Modifier and TypeMethodDescriptiongetRootDir(File projectDir) Returns the root directory for documentation scanning, falling back to input if unset.booleanReturns true if directory guidance inheritance is enabled.booleanReturns true if parent guidances are used in document preparation.voidprocessFolder(org.machanism.machai.project.layout.ProjectLayout projectLayout) Processes the project layout for documentation gathering.voidscanDocuments(File basedir) Scans documents in the given root directory and prepares inputs for documentation generation.voidscanDocuments(File rootDir, File dir) Scans documents in the given root directory and start subdirectory, preparing inputs for documentation generation.voidscanFolder(File projectDir) Recursively scans project folders, processing documentation inputs for all found modules and files.voidsetInheritance(boolean inheritance) Sets whether directory guidance inheritance is enabled.voidsetUseParentsGuidances(boolean useParentsGuidances) Sets whether parent guidances are included in documentation preparation.Methods inherited from class org.machanism.machai.project.ProjectProcessor
getProjectLayout, processModule
-
Field Details
-
GUIDANCE_TAG_NAME
-
-
Constructor Details
-
FileProcessor
public FileProcessor(org.machanism.machai.ai.manager.GenAIProvider provider) Constructs a FileProcessor for documentation input preparation.- Parameters:
provider- the AI provider for document generation
-
-
Method Details
-
scanDocuments
Scans documents in the given root directory and prepares inputs for documentation generation. This overload defaults the scan start directory to rootDir.- Parameters:
basedir- root directory to scan- Throws:
IOException- if an error occurs reading files
-
scanDocuments
Scans documents in the given root directory and start subdirectory, preparing inputs for documentation generation.- Parameters:
rootDir- the root directory of the project to scandir- the directory to begin scanning- Throws:
IOException- if an error occurs reading files
-
scanFolder
Recursively scans project folders, processing documentation inputs for all found modules and files.- Overrides:
scanFolderin classorg.machanism.machai.project.ProjectProcessor- Parameters:
projectDir- the directory containing the project/module to be scanned- Throws:
IOException- if an error occurs reading files
-
processFolder
public void processFolder(org.machanism.machai.project.layout.ProjectLayout projectLayout) Processes the project layout for documentation gathering.- Specified by:
processFolderin classorg.machanism.machai.project.ProjectProcessor- Parameters:
projectLayout- layout describing sources, tests, docs, and modules
-
getRootDir
-
isInheritance
public boolean isInheritance()Returns true if directory guidance inheritance is enabled.- Returns:
- inheritance enabled flag
-
setInheritance
public void setInheritance(boolean inheritance) Sets whether directory guidance inheritance is enabled.- Parameters:
inheritance- true to enable inheritance
-
isUseParentsGuidances
public boolean isUseParentsGuidances()Returns true if parent guidances are used in document preparation.- Returns:
- parent guidance enabled flag
-
setUseParentsGuidances
public void setUseParentsGuidances(boolean useParentsGuidances) Sets whether parent guidances are included in documentation preparation.- Parameters:
useParentsGuidances- true to enable use of parent guidances
-