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