Class HtmlReviewer

java.lang.Object
org.machanism.machai.gw.reviewer.HtmlReviewer
All Implemented Interfaces:
Reviewer

public class HtmlReviewer extends Object implements Reviewer
Reviewer implementation for HTML and XML files (.html, .htm, .xml).

Guidance is expected to appear in an HTML/XML comment block (for example <!-- @guidance ... -->).

  • Constructor Details

    • HtmlReviewer

      public HtmlReviewer()
  • Method Details

    • getSupportedFileExtensions

      public String[] getSupportedFileExtensions()
      Returns the file extensions supported by this reviewer.
      Specified by:
      getSupportedFileExtensions in interface Reviewer
      Returns:
      an array containing "html", "htm", and "xml"
    • perform

      public String perform(File projectDir, File guidancesFile) throws IOException
      Reviews the given file and returns a formatted prompt fragment when guidance is present.
      Specified by:
      perform in interface Reviewer
      Parameters:
      projectDir - the project root directory used to compute a project-relative path for context
      guidancesFile - the HTML/XML file to analyze
      Returns:
      a formatted prompt fragment, or null when the file does not contain guidance
      Throws:
      IOException - if an error occurs while reading the file