Package VASSAL.build

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()
    • 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)
    • 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 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:
      c - 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()
    • getCause

      public Throwable getCause()
    • getData

      public String getData()