jericho 2002/10/09 05:47:19
Modified: src/util/org/apache/util URIException.java
Log:
- Add the getReason method
Throwable doesn't support setMessage() method (only getMessage) or protected
variable instance. So it has the own message treat method.
Revision Changes Path
1.4 +35 -6 jakarta-slide/src/util/org/apache/util/URIException.java
Index: URIException.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/util/org/apache/util/URIException.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- URIException.java 29 Sep 2002 09:13:12 -0000 1.3
+++ URIException.java 9 Oct 2002 12:47:19 -0000 1.4
@@ -103,7 +103,8 @@
* @param reason the reason
*/
public URIException(int reasonCode, String reason) {
- super(reason);
+ super(reason); // for backward compatibility of Throwable
+ this.reason = reason;
setReasonCode(reasonCode);
}
@@ -114,7 +115,8 @@
* @param reason the reason
*/
public URIException(String reason) {
- super(reason);
+ super(reason); // for backward compatibility of Throwable
+ this.reason = reason;
setReasonCode(UNKNOWN);
}
@@ -147,6 +149,12 @@
*/
protected int reasonCode;
+
+ /**
+ * The reason message.
+ */
+ protected String reason;
+
// ---------------------------------------------------------------- methods
/**
@@ -167,6 +175,27 @@
public void setReasonCode(int reasonCode) {
this.reasonCode = reasonCode;
}
+
+
+ /**
+ * Get the reason message.
+ *
+ * @return the reason message
+ */
+ public String getReason() {
+ return reason;
+ }
+
+
+ /**
+ * Set the reason message.
+ *
+ * @param the reason message
+ */
+ public void setReason(String reason) {
+ this.reason = reason;
+ }
+
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>