Class MessagePackLoader

java.lang.Object
org.ek9lang.compiler.common.MessagePackLoader

public class MessagePackLoader extends Object
Loads alternative error messages and DI guidance from a zip file. The zip structure mirrors the built-in resource layout:
  manifest.properties
  richErrorMessages/rich-error-manifest.txt
  richErrorMessages/E01010.txt
  diAnalysis/di-analysis-manifest.txt
  diAnalysis/di-health-good.txt
  qaExamples/qa-manifest.txt
  qaExamples/gettingStarted/QA0001_minimal_program.ek9

All directories are optional — a zip can override just error messages, just DI guidance, just QA examples, or any combination. The manifest.properties is required.

  • Constructor Details

    • MessagePackLoader

      public MessagePackLoader()
  • Method Details

    • loadRichMessages

      public Map<String,String> loadRichMessages(Path zipPath)
      Load rich error message overrides from the zip.
      Parameters:
      zipPath - path to the message pack zip file
      Returns:
      map of error code to message text, empty if no rich error manifest in zip
    • loadDiGuidance

      public Map<String,String> loadDiGuidance(Path zipPath)
      Load DI guidance overrides from the zip.
      Parameters:
      zipPath - path to the message pack zip file
      Returns:
      map of guidance key to message text, empty if no DI guidance manifest in zip
    • loadQaExamples

      public Map<String,String> loadQaExamples(Path zipPath)
      Load QA example overrides from the zip. Returns raw file content keyed by the manifest path (e.g., "qaExamples/gettingStarted/QA0001_minimal_program.ek9").
      Parameters:
      zipPath - path to the message pack zip file
      Returns:
      map of manifest path to raw .ek9 file content, empty if no QA manifest in zip