Class BadDataReport

java.lang.Object
VASSAL.build.BadDataReport

public class BadDataReport extends Object
General-purpose condition indicating that VASSAL has encountered data that's inconsistent with the current module. A typical example would be failing to find a map/board/image/prototype from the supplied name. Covers a variety of situations where the most likely cause is a module version compatibility issue. This is for recoverable errors that occur during game play, as opposed to IllegalBuildException, which covers errors when building a module
Author:
rodneykinney
  • Constructor Details

    • BadDataReport

      public BadDataReport()
      Does having Auditing turned on supply any additional information?
    • BadDataReport

      public BadDataReport(String message, String data, Throwable cause)
      Basic Bad Data Report
      Parameters:
      message - Message to display
      data - Data causing error
      cause - Throwable that generated error
    • BadDataReport

      public BadDataReport(String message, String data, ExpressionException cause)
      BadDataReport for an Exception raised during Expression Execution
      Parameters:
      message - Message to display
      data - Data causing error
      cause - Throwable that generated error
    • BadDataReport

      public BadDataReport(String message, String data, Throwable cause, Auditable owner, AuditTrail auditTrail)
      BadDataReport for a general exception raised during Expression Execution with supplied audit info
      Parameters:
      message - Message to display
      data - Data causing error
      cause - Throwable that generated error
      owner - Owning component
      auditTrail - Audit Trail of expression execution
    • BadDataReport

      public BadDataReport(String message, String data)
      Generic Bad Data Report, no exeption
      Parameters:
      message - Message to display
      data - Data causing error
    • BadDataReport

      public BadDataReport(EditablePiece piece, String message, String data, Throwable cause)
      Expanded Bad Data Report called by Traits. Display additional information to aid debugging NB. Note use of piece.getLocalizedName() rather than Decorator.getOuterMost().getLocalizedName() which can result in infinite BadData reporting loops.
      Parameters:
      piece - Trait that generated the error
      message - Resource message key to display
      data - Data causing error
      cause - Throwable that generated error
    • BadDataReport

      public BadDataReport(EditablePiece piece, String message, String data)
    • BadDataReport

      public BadDataReport(EditablePiece piece, String message)
    • BadDataReport

      public BadDataReport(String pieceName, String traitDesc, String message, String data, Throwable cause)
    • BadDataReport

      public BadDataReport(AbstractConfigurable c, String message, String data, Throwable cause)
      Expanded Bad Data Report for AbstractConfigurables. Display the name and type of the Configurable
      Parameters:
      c - AbstractConfigurable that generated the error
      message - Resource message key to display
      data - Data causing error
      cause - Throwable that generated error
    • BadDataReport

      public BadDataReport(AbstractConfigurable c, String message, String data, Throwable cause, boolean additionalInfo)
      Expanded Bad Data Report for AbstractConfigurables. Display the name and type of the Configurable
      Parameters:
      c - AbstractConfigurable that generated the error
      message - Resource message key to display
      data - Data causing error
      cause - Throwable that generated error
      additionalInfo - true if additional information is provided if auditing turned on.
    • BadDataReport

      public BadDataReport(AbstractConfigurable c, String messageKey, String data)
    • BadDataReport

      public BadDataReport(PieceSlot slot, String message, String data)
      Expanded Bad Data Report for PieceSlot Display the name of the slot
      Parameters:
      slot - PieceSlot that generated the error
      message - Resource message key to display
      data - Data causing error
  • Method Details

    • getPieceName

      protected static String getPieceName(EditablePiece piece)
      Return the name of the piece. For Decorators, return the name of the inner piece as the Bad Data Report may have been generated by the call to get the name of the Decorator in the first place.
      Parameters:
      piece -
      Returns:
    • isReportable

      public boolean isReportable()
      Should this report be reported?
      Returns:
      false if this report should be ignored
    • setReportable

      public void setReportable(boolean reportable)
    • getMessage

      public String getMessage()
      Build a single line printable message for this Bad Data Report
      Returns:
      message
    • getCause

      public Throwable getCause()
    • getData

      public String getData()
    • getAuditTrail

      public AuditTrail getAuditTrail()
    • getAuditReport

      public String getAuditReport()
    • getFullData

      public String getFullData()
      Return the full audit trail if it exists
      Returns:
      full data message