Class BasicReporter

java.lang.Object
uk.ac.starlink.tfcat.BasicReporter
All Implemented Interfaces:
Reporter

public class BasicReporter extends Object implements Reporter
Standard reporter implementation.
Since:
9 Feb 2022
Author:
Mark Taylor
  • Constructor Summary

    Constructors
    Constructor
    Description
    BasicReporter(boolean isDebug)
    Constructs a BasicReporter with no UCD or VOUnit validation.
    BasicReporter(boolean isDebug, WordChecker ucdChecker, WordChecker unitChecker)
    Constructs a BasicReporter with configurable UCD and VOUnit validation.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Report on validity of the supplied Uniform Content Descriptor.
    void
    Report on validity of the supplied unit string.
    createReporter(int subContext)
    Returns a reporter suitable for use in a subcontext characterised by an integer, that usually means an indexed array element below the current level.
    createReporter(String subContext)
    Returns a reporter suitable for use in a subcontext characterised by a string, that usually means a level down in the object hierarchy.
    Returns a list of all the messages accumulated by this reporter and its sub-reporters.
    void
    report(String message)
    Reports an error message.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BasicReporter

      public BasicReporter(boolean isDebug)
      Constructs a BasicReporter with no UCD or VOUnit validation.
      Parameters:
      isDebug - if true, reports will be trigger a stack trace on standard error
    • BasicReporter

      public BasicReporter(boolean isDebug, WordChecker ucdChecker, WordChecker unitChecker)
      Constructs a BasicReporter with configurable UCD and VOUnit validation.
      Parameters:
      isDebug - if true, reports will be trigger a stack trace on standard error
      ucdChecker - checks UCD strings
      unitChecker - checks unit strings
  • Method Details

    • getMessages

      public List<String> getMessages()
      Returns a list of all the messages accumulated by this reporter and its sub-reporters.
      Returns:
      message list; empty for fully valid input
    • createReporter

      public BasicReporter createReporter(String subContext)
      Description copied from interface: Reporter
      Returns a reporter suitable for use in a subcontext characterised by a string, that usually means a level down in the object hierarchy.
      Specified by:
      createReporter in interface Reporter
      Parameters:
      subContext - subcontext designation
      Returns:
      new reporter
    • createReporter

      public BasicReporter createReporter(int subContext)
      Description copied from interface: Reporter
      Returns a reporter suitable for use in a subcontext characterised by an integer, that usually means an indexed array element below the current level.
      Specified by:
      createReporter in interface Reporter
      Parameters:
      subContext - subcontext designation
      Returns:
      new reporter
    • report

      public void report(String message)
      Description copied from interface: Reporter
      Reports an error message. The message should generally contain human-readable information about some conformance error, but the location of the error is not required.
      Specified by:
      report in interface Reporter
      Parameters:
      message - human-readable message
    • checkUcd

      public void checkUcd(String ucd)
      Description copied from interface: Reporter
      Report on validity of the supplied Uniform Content Descriptor. Any issues of concern will be reported.
      Specified by:
      checkUcd in interface Reporter
      Parameters:
      ucd - UCD
      See Also:
    • checkUnit

      public void checkUnit(String unit)
      Description copied from interface: Reporter
      Report on validity of the supplied unit string. Any issues of concern will be reported.
      Specified by:
      checkUnit in interface Reporter
      Parameters:
      unit - unit string
      See Also: