snichol 2002/11/26 19:05:08
Modified: java/src/org/apache/soap SOAPException.java
Log:
Submitted by: "Shannon Lal" <[EMAIL PROTECTED]>
Add javadoc.
Revision Changes Path
1.7 +55 -0 xml-soap/java/src/org/apache/soap/SOAPException.java
Index: SOAPException.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/SOAPException.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SOAPException.java 18 Oct 2002 20:27:18 -0000 1.6
+++ SOAPException.java 27 Nov 2002 03:05:08 -0000 1.7
@@ -63,6 +63,16 @@
/**
* <em>SOAP</em> Exceptions.
*
+ * This class is the main exception that is thrown from the
+ * SOAP system. This exception inherits from Exception and
+ * contains two attributes: faultCode and targetException.
+ * The fault Code is the SOAP fault code for the error and
+ * the target Exception is the original exception that
+ * that generated the error (i.e. NullPointerException, ..).
+ *
+ * When a SOAPException is thrown during execution of a service,
+ * a SOAP Fault is returned to the client.
+ *
* @author Sanjiva Weerawarana ([EMAIL PROTECTED])
* @author Matthew J. Duftler ([EMAIL PROTECTED])
* @author Scott Nichol ([EMAIL PROTECTED])
@@ -71,37 +81,78 @@
private String faultCode;
private Throwable targetException;
+ /**
+ * Constructor for the SOAP Exception which sets the
+ * faultCode and msg.
+ * @param faultCode
+ * @param msg
+ */
public SOAPException (String faultCode, String msg) {
super(msg);
this.faultCode = faultCode;
}
+ /**
+ * Constructor for the SOAP Exception which sets the
+ * faultCode, msg, and the targetException
+ * @param faultCode
+ * @param msg
+ * @param targetException
+ */
public SOAPException (String faultCode, String msg,
Throwable targetException) {
this(faultCode, msg);
this.targetException = targetException;
}
+ /**
+ * Sets the fault code for the exception
+ * @param faultCode
+ */
public void setFaultCode (String faultCode) {
this.faultCode = faultCode;
}
+ /**
+ * Returns the fault code of the exception
+ * @return String
+ */
public String getFaultCode () {
return faultCode;
}
+ /**
+ * Sets the target exception.
+ * @param targetException
+ */
public void setTargetException (Throwable targetException) {
this.targetException = targetException;
}
+ /**
+ * Returns the target exception. If target exception is null, returns null
+ * Recommended to use getRootException (will not return null)
+ * @return Throwable
+ */
public Throwable getTargetException () {
return targetException;
}
+ /**
+ * Returns the root exception. If target
+ * exception is not null, it returns the target
+ * otherwise it returns the a reference to
+ * itself (i.e. this).
+ * @return Throwable
+ */
public Throwable getRootException() {
return targetException != null ? targetException : this;
}
+ /**
+ * This will return the message for the exception
+ * @return String
+ */
public String getMessage () {
String superMsg = super.getMessage ();
String targetMsg = (targetException != null)
@@ -156,6 +207,10 @@
}
}
+ /**
+ * Returns a String format of the exception
+ * @return String
+ */
public String toString () {
return "[SOAPException: faultCode=" + faultCode + "; msg=" +
super.getMessage () + ((targetException != null)
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>