View Javadoc

1   /*
2    * $Id: StrutsException.java 651946 2008-04-27 13:41:38Z apetrelli $
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  package org.apache.struts2;
23  
24  import com.opensymphony.xwork2.XWorkException;
25  import com.opensymphony.xwork2.util.location.Locatable;
26  
27  
28  /***
29   * A generic runtime exception that optionally contains Location information
30   */
31  public class StrutsException extends XWorkException implements Locatable {
32  
33      private static final long serialVersionUID = 888724366243600135L;
34  
35  
36      /***
37       * Constructs a <code>StrutsException</code> with no detail message.
38       */
39      public StrutsException() {
40      }
41  
42      /***
43       * Constructs a <code>StrutsException</code> with the specified
44       * detail message.
45       *
46       * @param s the detail message.
47       */
48      public StrutsException(String s) {
49          this(s, null, null);
50      }
51  
52      /***
53       * Constructs a <code>StrutsException</code> with the specified
54       * detail message and target.
55       *
56       * @param s the detail message.
57       * @param target the target of the exception.
58       */
59      public StrutsException(String s, Object target) {
60          this(s, (Throwable) null, target);
61      }
62  
63      /***
64       * Constructs a <code>StrutsException</code> with the root cause
65       *
66       * @param cause The wrapped exception
67       */
68      public StrutsException(Throwable cause) {
69          this(null, cause, null);
70      }
71  
72      /***
73       * Constructs a <code>StrutsException</code> with the root cause and target
74       *
75       * @param cause The wrapped exception
76       * @param target The target of the exception
77       */
78      public StrutsException(Throwable cause, Object target) {
79          this(null, cause, target);
80      }
81  
82      /***
83       * Constructs a <code>StrutsException</code> with the specified
84       * detail message and exception cause.
85       *
86       * @param s the detail message.
87       * @param cause the wrapped exception
88       */
89      public StrutsException(String s, Throwable cause) {
90          this(s, cause, null);
91      }
92  
93  
94       /***
95       * Constructs a <code>StrutsException</code> with the specified
96       * detail message, cause, and target
97       *
98       * @param s the detail message.
99       * @param cause The wrapped exception
100      * @param target The target of the exception
101      */
102     public StrutsException(String s, Throwable cause, Object target) {
103         super(s, cause, target);
104     }
105 }