Class RichMessageWithExample

java.lang.Object
org.ek9lang.compiler.common.RichMessageWithExample
All Implemented Interfaces:
Function<String,String>, UnaryOperator<String>

public final class RichMessageWithExample extends Object implements UnaryOperator<String>
The rich message for an error code followed by its [EXAMPLE] section: the error catalogue's compiled failing source and its compiled fixes (ErrorExamples.plainText(String) of ErrorExamples.CATALOGUE), as plain text. This is what ek9 -h <CODE> and -E3 show; a code the catalogue holds nothing for shows its message unchanged. The example is never part of a message pack - a pack replaces the prose, the catalogue is the code. Hold an instance.
  • Constructor Details

    • RichMessageWithExample

      public RichMessageWithExample()
  • Method Details

    • apply

      public String apply(String errorCode)
      The rich message with its example section.
      Specified by:
      apply in interface Function<String,String>
      Parameters:
      errorCode - The error code (e.g., "E07235")
      Returns:
      The rich message with its example section, or null if there is no rich message