Class ErrorMode

java.lang.Object
uk.ac.starlink.table.formats.ErrorMode

public abstract class ErrorMode extends Object
Defines how error messages are reported.
Since:
30 Apr 2021
Author:
Mark Taylor
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ErrorMode
    Messages are thrown as TableFormatExceptions, probably causing read failure.
    static final ErrorMode
    Messages are ignored.
    static final ErrorMode[]
    Known values.
    static final ErrorMode
    Messages are written as WARNINGs through the logging system.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ErrorMode(String name, boolean isReport)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if text reports submitted may ever be used for any purpose.
    abstract void
    Consumes a report string in a way appropriate for this mode.
    Returns this option's name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • IGNORE

      public static final ErrorMode IGNORE
      Messages are ignored.
    • WARN

      public static final ErrorMode WARN
      Messages are written as WARNINGs through the logging system.
    • FAIL

      public static final ErrorMode FAIL
      Messages are thrown as TableFormatExceptions, probably causing read failure.
    • OPTIONS

      public static final ErrorMode[] OPTIONS
      Known values.
  • Constructor Details

    • ErrorMode

      protected ErrorMode(String name, boolean isReport)
      Constructor.
      Parameters:
      name - mode name
      isReport - true if text reports are ever used for anything
  • Method Details

    • isReport

      public boolean isReport()
      Returns true if text reports submitted may ever be used for any purpose. If this returns false, there's no point submitting reports.
      Returns:
      true if reports may be used
    • toString

      public String toString()
      Returns this option's name.
      Overrides:
      toString in class Object
    • report

      public abstract void report(String msg) throws IOException
      Consumes a report string in a way appropriate for this mode.
      Parameters:
      msg - message to report
      Throws:
      IOException