Skip to content

Class BuildException

Javadoc 27 generates this reference during each site build from the exported packages and the annotation processor. The Java guide shows the API in use.

All Implemented Interfaces:
Serializable
public final class BuildException extends RuntimeException
Thrown when a reader spec cannot be built: a builder check failed, or the language rejected the emitted text.

kind names the check. A check that one statement can fail throws at that statement's call; the checks of the whole spec throw from Builder.source() and Builder.build(). Either way callSite names the line of the caller's code that made the statement, and getMessage() ends with it.

  • Method Details

    • getMessage

      public String getMessage()
      Returns the message: the error code for a BuildException.Kind.SPEC failure, the reason, the emitted line if there is one, and the call site.
      Overrides:
      getMessage in class Throwable
      Returns:
      the message: the error code for a BuildException.Kind.SPEC failure, the reason, the emitted line if there is one, and the call site
    • kind

      public BuildException.Kind kind()
      Returns the check that failed.
      Returns:
      the check that failed
    • reason

      public String reason()
      Returns the reason, without the error code, the emitted line and the call site that getMessage() adds.
      Returns:
      the reason, without the error code, the emitted line and the call site that getMessage() adds
    • callSite

      public @Nullable StackTraceElement callSite()
      Returns the line of the caller's code that made the failing statement, or null if no caller is known.
      Returns:
      the line of the caller's code that made the failing statement, or null if no caller is known
    • text

      public @Nullable String text()
      Returns the emitted text, when the language rejected it, and otherwise null.
      Returns:
      the emitted text, when the language rejected it, and otherwise null
    • failure

      public @Nullable IrisException failure()
      Returns the language error, when the language rejected the emitted text, or null.
      Returns:
      the language error, when the language rejected the emitted text, or null
    • emittedLine

      public @Nullable String emittedLine()
      Returns the line of emitted text that the language error points at, or null.
      Returns:
      the line of emitted text that the language error points at, or null