Failure Method




Indicates that the Java class failed to complete its actions successfully. You must call either the failure method or the success method in your Java class.


Variable Description
sErrorString Optional: String that indicates the reason for failure. STRING.


If you call failure without any arguments, it passes the boolean value FALSE back to the InvokeJava method to indicate that the Java class failed to complete its actions.

If you call failure with an sErrorString argument, the method passes to InvokeJava the boolean value FALSE followed by sErrorString to indicate the reason why the Java class failed to complete its actions.

QapJava.failure indicates that InvokeJava was called with an invalid object. It also indicates:

  • That the object used to call InvokeJava was not of the expected type.
  • That there were no nodes in the tree view object.

This method can be called with an optional string argument that describes the error that caused the Java class to fail.

Once failure is called, the InvokeJava method terminates.


import segue.qapjava.QapJava;
Object objRef;
objRef = QapJava.getObject();
if (objRef == null)
 QapJava.failure("Couldn't find object");
else {