001: /***************************************************************
002: * This file is part of the [fleXive](R) project.
003: *
004: * Copyright (c) 1999-2008
005: * UCS - unique computing solutions gmbh (http://www.ucs.at)
006: * All rights reserved
007: *
008: * The [fleXive](R) project is free software; you can redistribute
009: * it and/or modify it under the terms of the GNU General Public
010: * License as published by the Free Software Foundation;
011: * either version 2 of the License, or (at your option) any
012: * later version.
013: *
014: * The GNU General Public License can be found at
015: * http://www.gnu.org/copyleft/gpl.html.
016: * A copy is found in the textfile GPL.txt and important notices to the
017: * license from the author are found in LICENSE.txt distributed with
018: * these libraries.
019: *
020: * This library is distributed in the hope that it will be useful,
021: * but WITHOUT ANY WARRANTY; without even the implied warranty of
022: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
023: * GNU General Public License for more details.
024: *
025: * For further information about UCS - unique computing solutions gmbh,
026: * please see the company website: http://www.ucs.at
027: *
028: * For further information about [fleXive](R), please see the
029: * project website: http://www.flexive.org
030: *
031: *
032: * This copyright notice MUST APPEAR in all copies of the file!
033: ***************************************************************/package com.flexive.shared.exceptions;
034:
035: import org.apache.commons.logging.Log;
036:
037: /**
038: * Exception that can occur whenever an invalid parameter was passed (localized).
039: * The name of the parameter is (always) the first parameter of any constructor and
040: * can be retrieved with <code>getParameter()</code>.
041: *
042: * @author Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
043: */
044: public class FxInvalidParameterException extends FxApplicationException {
045:
046: private String parameter;
047: private static final long serialVersionUID = -2833608098491155070L;
048:
049: /**
050: * Get the name of the parameter flagged as invalid
051: *
052: * @return name of the parameter flagged as invalid
053: */
054: public String getParameter() {
055: return parameter;
056: }
057:
058: /**
059: * Localized exception constructor
060: *
061: * @param converted
062: */
063: public FxInvalidParameterException(String parameter,
064: FxApplicationException converted) {
065: super (converted);
066: this .parameter = parameter;
067: }
068:
069: /**
070: * Localized exception constructor
071: *
072: * @param log
073: * @param converted
074: */
075: public FxInvalidParameterException(String parameter, Log log,
076: FxApplicationException converted) {
077: super (log, converted);
078: this .parameter = parameter;
079: }
080:
081: /**
082: * Localized exception constructor
083: *
084: * @param key
085: * @param values
086: */
087: public FxInvalidParameterException(String parameter, String key,
088: Object... values) {
089: super (key, values);
090: this .parameter = parameter;
091: }
092:
093: /**
094: * Localized exception constructor
095: *
096: * @param log
097: * @param key
098: * @param values
099: */
100: public FxInvalidParameterException(String parameter, Log log,
101: String key, Object... values) {
102: super (log, key, values);
103: this .parameter = parameter;
104: }
105:
106: /**
107: * Localized exception constructor
108: *
109: * @param cause
110: * @param key
111: * @param values
112: */
113: public FxInvalidParameterException(String parameter,
114: Throwable cause, String key, Object... values) {
115: super (cause, key, values);
116: this .parameter = parameter;
117: }
118:
119: /**
120: * Localized exception constructor
121: *
122: * @param log
123: * @param cause
124: * @param key
125: * @param values
126: */
127: public FxInvalidParameterException(String parameter, Log log,
128: Throwable cause, String key, Object... values) {
129: super (log, cause, key, values);
130: this .parameter = parameter;
131: }
132:
133: /**
134: * Localized exception constructor
135: *
136: * @param key
137: */
138: public FxInvalidParameterException(String parameter, String key) {
139: super (key);
140: this .parameter = parameter;
141: }
142:
143: /**
144: * Localized exception constructor
145: *
146: * @param log
147: * @param key
148: */
149: public FxInvalidParameterException(String parameter, Log log,
150: String key) {
151: super (log, key);
152: this .parameter = parameter;
153: }
154:
155: /**
156: * Localized exception constructor
157: *
158: * @param message
159: * @param cause
160: */
161: public FxInvalidParameterException(String parameter,
162: String message, Throwable cause) {
163: super (message, cause);
164: this .parameter = parameter;
165: }
166:
167: /**
168: * Localized exception constructor
169: *
170: * @param log
171: * @param message
172: * @param cause
173: */
174: public FxInvalidParameterException(String parameter, Log log,
175: String message, Throwable cause) {
176: super (log, message, cause);
177: this .parameter = parameter;
178: }
179:
180: /**
181: * Localized exception constructor
182: *
183: * @param cause
184: */
185: public FxInvalidParameterException(String parameter, Throwable cause) {
186: super (cause);
187: this .parameter = parameter;
188: }
189:
190: /**
191: * Localized exception constructor
192: *
193: * @param log
194: * @param cause
195: */
196: public FxInvalidParameterException(String parameter, Log log,
197: Throwable cause) {
198: super (log, cause);
199: this .parameter = parameter;
200: }
201:
202: /**
203: * {@inheritDoc}
204: */
205: @Override
206: public FxInvalidParameterException setAffectedXPath(
207: String affectedXPath) {
208: super.setAffectedXPath(affectedXPath);
209: return this;
210: }
211: }
|