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

Both directories are optional — a zip can override just error messages, just DI guidance, or both. 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