View Javadoc
1   /**
2    * Copyright 2007 Björn Voß
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5    * use this file except in compliance with the License. You may obtain a copy of
6    * the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations under
14   * the License.
15   */
16  package net.sf.oxclient.communication.json;
17  
18  import java.util.ArrayList;
19  import java.util.List;
20  
21  import net.sf.oval.constraint.NotNull;
22  import net.sf.oval.guard.Guarded;
23  import net.sf.oxclient.GroupwareException;
24  
25  /**
26   * @author Björn Voß
27   *
28   */
29  @Guarded
30  public class JSONException extends GroupwareException {
31  
32  	private static final long serialVersionUID = -1390092059561550659L;
33  
34  	private String code;
35  	private String errorId;
36  	private int category;
37  	private List<Integer> errorParams = new ArrayList<Integer>();
38  
39  	public JSONException() {
40  		super();
41  	}
42  
43  	public JSONException(final String arg0) {
44  		super(arg0);
45  	}
46  
47  	public JSONException(final String arg0, final Throwable arg1) {
48  		super(arg0, arg1);
49  	}
50  
51  	public JSONException(final Throwable arg0) {
52  		super(arg0);
53  	}
54  
55  	public String getCode() {
56  		return this.code;
57  	}
58  
59  	public void setCode(final String code) {
60  		this.code = code;
61  	}
62  
63  	public String getErrorId() {
64  		return this.errorId;
65  	}
66  
67  	public void setErrorId(final String errorId) {
68  		this.errorId = errorId;
69  	}
70  
71  	public int getCategory() {
72  		return this.category;
73  	}
74  
75  	public void setCategory(final int category) {
76  		this.category = category;
77  	}
78  
79  	public List<Integer> getErrorParams() {
80  		return this.errorParams;
81  	}
82  
83  	public void setErrorParams(@NotNull final List<Integer> errorParams) {
84  		this.errorParams = errorParams;
85  	}
86  
87  	public void addErrorParam(final int errorParam) {
88  		this.errorParams.add(errorParam);
89  	}
90  
91  }