127 public Throwable getCause() {
128 return cause;
129 }
130
131 /**
132 * Initializes the <code>cause</code> field of this <code>SOAPExceptionImpl</code>
133 * object with the given <code>Throwable</code> object.
134 * <P>
135 * This method can be called at most once. It is generally called from
136 * within the constructor or immediately after the constructor has
137 * returned a new <code>SOAPExceptionImpl</code> object.
138 * If this <code>SOAPExceptionImpl</code> object was created with the
139 * constructor {@link #SOAPExceptionImpl(Throwable)} or
140 * {@link #SOAPExceptionImpl(String,Throwable)}, meaning that its
141 * <code>cause</code> field already has a value, this method cannot be
142 * called even once.
143 *
144 * @param cause the <code>Throwable</code> object that caused this
145 * <code>SOAPExceptionImpl</code> object to be thrown. The value of this
146 * parameter is saved for later retrieval by the
147 * {@link #getCause()} method. A <tt>null</tt> value is
148 * permitted and indicates that the cause is nonexistent or
149 * unknown.
150 * @return a reference to this <code>SOAPExceptionImpl</code> instance
151 * @throws IllegalArgumentException if <code>cause</code> is this
152 * <code>Throwable</code> object. (A <code>Throwable</code> object
153 * cannot be its own cause.)
154 * @throws IllegalStateException if this <code>SOAPExceptionImpl</code> object
155 * was created with {@link #SOAPExceptionImpl(Throwable)} or
156 * {@link #SOAPExceptionImpl(String,Throwable)}, or this
157 * method has already been called on this <code>SOAPExceptionImpl</code>
158 * object
159 */
160 public synchronized Throwable initCause(Throwable cause)
161 {
162 if(this.cause != null) {
163 throw new IllegalStateException("Can't override cause");
164 }
165 if(cause == this) {
166 throw new IllegalArgumentException("Self-causation not permitted");
167 }
|
127 public Throwable getCause() {
128 return cause;
129 }
130
131 /**
132 * Initializes the <code>cause</code> field of this <code>SOAPExceptionImpl</code>
133 * object with the given <code>Throwable</code> object.
134 * <P>
135 * This method can be called at most once. It is generally called from
136 * within the constructor or immediately after the constructor has
137 * returned a new <code>SOAPExceptionImpl</code> object.
138 * If this <code>SOAPExceptionImpl</code> object was created with the
139 * constructor {@link #SOAPExceptionImpl(Throwable)} or
140 * {@link #SOAPExceptionImpl(String,Throwable)}, meaning that its
141 * <code>cause</code> field already has a value, this method cannot be
142 * called even once.
143 *
144 * @param cause the <code>Throwable</code> object that caused this
145 * <code>SOAPExceptionImpl</code> object to be thrown. The value of this
146 * parameter is saved for later retrieval by the
147 * {@link #getCause()} method. A {@code null} value is
148 * permitted and indicates that the cause is nonexistent or
149 * unknown.
150 * @return a reference to this <code>SOAPExceptionImpl</code> instance
151 * @throws IllegalArgumentException if <code>cause</code> is this
152 * <code>Throwable</code> object. (A <code>Throwable</code> object
153 * cannot be its own cause.)
154 * @throws IllegalStateException if this <code>SOAPExceptionImpl</code> object
155 * was created with {@link #SOAPExceptionImpl(Throwable)} or
156 * {@link #SOAPExceptionImpl(String,Throwable)}, or this
157 * method has already been called on this <code>SOAPExceptionImpl</code>
158 * object
159 */
160 public synchronized Throwable initCause(Throwable cause)
161 {
162 if(this.cause != null) {
163 throw new IllegalStateException("Can't override cause");
164 }
165 if(cause == this) {
166 throw new IllegalArgumentException("Self-causation not permitted");
167 }
|