Class RequirementFailure

All Implemented Interfaces:
Serializable

public class RequirementFailure extends RuntimeException
RuntimeException to be thrown on requirement failures.
See Also:
  • Constructor Details

    • RequirementFailure

      public RequirementFailure(String message, int nCallsBelowRequirer)
    • RequirementFailure

      public RequirementFailure(String message, Exception caughtException, int nCallsBelowRequirer)
  • Method Details

    • getNumCallsBelowRequirer

      public int getNumCallsBelowRequirer()
      Gets the number of stack frames that should be removed from the stack to find the caller which failed to meet requirements.
    • printStackTrace

      public void printStackTrace()
      Overrides:
      printStackTrace in class Throwable
    • printStackTrace

      public void printStackTrace(PrintStream s)
      Overrides:
      printStackTrace in class Throwable
    • printStackTrace

      public void printStackTrace(PrintWriter s)
      Overrides:
      printStackTrace in class Throwable
    • getOriginalStackTrace

      public StringBuffer getOriginalStackTrace()
      Gets the unmodified stack trace, instead of the one with the culprit identified.
    • adjustForDelegatingMethod

      public RequirementFailure adjustForDelegatingMethod()
      If this stack frame caused the exception, adjust the culprit to be the caller. Used when a delegating method can't verify all requirements itself but shouldn't receive the blame.
    • adjustForDelegatingMethodAndSyntheticAccessor

      public RequirementFailure adjustForDelegatingMethodAndSyntheticAccessor()
      If this stack frame caused the exception, adjust the culprit to be the caller. Used when a delegating method can't verify all requirements itself but shouldn't receive the blame.
    • isThisStackFrameCulprit

      public boolean isThisStackFrameCulprit(int nFramesBelowTargetFrame)
      Returns true if this stack frame is blamed for causing the exception.