View Javadoc

1   /*
2    * $Id: StrutsException.java 471756 2006-11-06 15:01:43Z husted $
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  package org.apache.struts2;
22  
23  import com.opensymphony.xwork2.XWorkException;
24  import com.opensymphony.xwork2.util.location.Locatable;
25  
26  
27  /***
28   * A generic runtime exception that optionally contains Location information
29   */
30  public class StrutsException extends XWorkException implements Locatable {
31  
32      private static final long serialVersionUID = 888724366243600135L;
33  
34  
35      /***
36       * Constructs a <code>StrutsException</code> with no detail message.
37       */
38      public StrutsException() {
39      }
40  
41      /***
42       * Constructs a <code>StrutsException</code> with the specified
43       * detail message.
44       *
45       * @param s the detail message.
46       */
47      public StrutsException(String s) {
48          this(s, null, null);
49      }
50  
51      /***
52       * Constructs a <code>StrutsException</code> with the specified
53       * detail message and target.
54       *
55       * @param s the detail message.
56       * @param target the target of the exception.
57       */
58      public StrutsException(String s, Object target) {
59          this(s, (Throwable) null, target);
60      }
61  
62      /***
63       * Constructs a <code>StrutsException</code> with the root cause
64       *
65       * @param cause The wrapped exception
66       */
67      public StrutsException(Throwable cause) {
68          this(null, cause, null);
69      }
70  
71      /***
72       * Constructs a <code>StrutsException</code> with the root cause and target
73       *
74       * @param cause The wrapped exception
75       * @param target The target of the exception
76       */
77      public StrutsException(Throwable cause, Object target) {
78          this(null, cause, target);
79      }
80  
81      /***
82       * Constructs a <code>StrutsException</code> with the specified
83       * detail message and exception cause.
84       *
85       * @param s the detail message.
86       * @param cause the wrapped exception
87       */
88      public StrutsException(String s, Throwable cause) {
89          this(s, cause, null);
90      }
91  
92  
93       /***
94       * Constructs a <code>StrutsException</code> with the specified
95       * detail message, cause, and target
96       *
97       * @param s the detail message.
98       * @param cause The wrapped exception
99       * @param target The target of the exception
100      */
101     public StrutsException(String s, Throwable cause, Object target) {
102         super(s, cause, target);
103     }
104 }