1 /**
2 * $Id: BaseExceptionDefImpl.java 58 2006-11-08 14:52:38Z maldito_orco $
3 *
4 * =========================================================================
5 *
6 * Copyright 2005 Tubo
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * 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, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20 package org.tubo.configuration.def.baseimpl;
21
22
23 import org.apache.commons.logging.Log;
24 import org.apache.commons.logging.LogFactory;
25
26 import org.tubo.configuration.def.ExceptionDef;
27
28 import java.util.List;
29 import java.util.ArrayList;
30
31 /**
32 * <p></p>
33 * <p>
34 * Created: Jun 27, 2005 6:59:40 PM <br>
35 * Last Modification Date: $Date: 2006-11-08 11:52:38 -0300 (Wed, 08 Nov 2006) $
36 * </p>
37 *
38 * @author maldito_orco (maldito_orco@users.sourceforge.net)
39 * @version $Revision: 58 $
40 */
41 public class BaseExceptionDefImpl extends BaseReferenceableItemDefImpl implements ExceptionDef {
42 public static final String RCS_ID = "$Id: BaseExceptionDefImpl.java 58 2006-11-08 14:52:38Z maldito_orco $";
43 private static Log log = LogFactory.getLog(BaseExceptionDefImpl.class);
44
45 private String exceptionClassname = null;
46 private List rankErrorCodesList = new ArrayList();
47
48 public String getExceptionClassname() { return exceptionClassname; }
49 public void setExceptionClassname(String exceptionClassname) {
50 this.exceptionClassname = exceptionClassname;
51 }
52
53 public List getRankErrorCodesList() {
54 return rankErrorCodesList;
55 }
56 public void addErrorCode(String strErrorCode) {
57
58
59 int errorCode = Integer.parseInt(strErrorCode.trim());
60
61
62 int[] rank = new int[] {errorCode,errorCode};
63 addRankToList(rank);
64 }
65 public void addRankErrorCodes(String strRankErrorCodes) {
66
67
68 String[] limits = strRankErrorCodes.split("[-,;:/|]");
69
70
71 int upperLimit = Integer.parseInt(limits[0]);
72 int lowerLimit = Integer.parseInt(limits[1]);
73
74
75 int[] rank = new int[] {upperLimit,lowerLimit};
76 addRankToList(rank);
77 }
78
79 private void addRankToList(int[] rank) {
80 rankErrorCodesList.add(rank);
81 }
82
83 }