View Javadoc

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