001: /*
002: * $Id: StrutsException.java 471756 2006-11-06 15:01:43Z husted $
003: *
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021: package org.apache.struts2;
022:
023: import com.opensymphony.xwork2.XWorkException;
024: import com.opensymphony.xwork2.util.location.Locatable;
025:
026: /**
027: * A generic runtime exception that optionally contains Location information
028: */
029: public class StrutsException extends XWorkException implements
030: Locatable {
031:
032: private static final long serialVersionUID = 888724366243600135L;
033:
034: /**
035: * Constructs a <code>StrutsException</code> with no detail message.
036: */
037: public StrutsException() {
038: }
039:
040: /**
041: * Constructs a <code>StrutsException</code> with the specified
042: * detail message.
043: *
044: * @param s the detail message.
045: */
046: public StrutsException(String s) {
047: this (s, null, null);
048: }
049:
050: /**
051: * Constructs a <code>StrutsException</code> with the specified
052: * detail message and target.
053: *
054: * @param s the detail message.
055: * @param target the target of the exception.
056: */
057: public StrutsException(String s, Object target) {
058: this (s, (Throwable) null, target);
059: }
060:
061: /**
062: * Constructs a <code>StrutsException</code> with the root cause
063: *
064: * @param cause The wrapped exception
065: */
066: public StrutsException(Throwable cause) {
067: this (null, cause, null);
068: }
069:
070: /**
071: * Constructs a <code>StrutsException</code> with the root cause and target
072: *
073: * @param cause The wrapped exception
074: * @param target The target of the exception
075: */
076: public StrutsException(Throwable cause, Object target) {
077: this (null, cause, target);
078: }
079:
080: /**
081: * Constructs a <code>StrutsException</code> with the specified
082: * detail message and exception cause.
083: *
084: * @param s the detail message.
085: * @param cause the wrapped exception
086: */
087: public StrutsException(String s, Throwable cause) {
088: this (s, cause, null);
089: }
090:
091: /**
092: * Constructs a <code>StrutsException</code> with the specified
093: * detail message, cause, and target
094: *
095: * @param s the detail message.
096: * @param cause The wrapped exception
097: * @param target The target of the exception
098: */
099: public StrutsException(String s, Throwable cause, Object target) {
100: super(s, cause, target);
101: }
102: }
|