Package uk.ac.starlink.table.formats
Class ErrorMode
- java.lang.Object
-
- uk.ac.starlink.table.formats.ErrorMode
-
public abstract class ErrorMode extends java.lang.ObjectDefines how error messages are reported.- Since:
- 30 Apr 2021
- Author:
- Mark Taylor
-
-
Field Summary
Fields Modifier and Type Field Description static ErrorModeFAILMessages are thrown as TableFormatExceptions, probably causing read failure.static ErrorModeIGNOREMessages are ignored.static ErrorMode[]OPTIONSKnown values.static ErrorModeWARNMessages are written as WARNINGs through the logging system.
-
Constructor Summary
Constructors Modifier Constructor Description protectedErrorMode(java.lang.String name, boolean isReport)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanisReport()Returns true if text reports submitted may ever be used for any purpose.abstract voidreport(java.lang.String msg)Consumes a report string in a way appropriate for this mode.java.lang.StringtoString()Returns this option's name.
-
-
-
Field Detail
-
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.
-
-
Method Detail
-
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 java.lang.String toString()
Returns this option's name.- Overrides:
toStringin classjava.lang.Object
-
report
public abstract void report(java.lang.String msg) throws java.io.IOExceptionConsumes a report string in a way appropriate for this mode.- Parameters:
msg- message to report- Throws:
java.io.IOException
-
-