View Javadoc

1   /*
2    * Copyright 2004-2009 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of 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,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springmodules.validation.valang;
18  
19  import org.springframework.core.NestedRuntimeException;
20  
21  public class ValangException extends NestedRuntimeException {
22  
23      private static final long serialVersionUID = -3223482349872384878L;
24  
25      private int line = 0;
26  
27      private int column = 0;
28  
29      public ValangException(String arg0, int line, int column) {
30          super(arg0);
31          this.line = line;
32          this.column = column;
33      }
34  
35      public ValangException(String arg0, Throwable arg1, int line, int column) {
36          super(arg0, arg1);
37          this.line = line;
38          this.column = column;
39      }
40  
41      public ValangException(Throwable t, int line, int column) {
42          super(t.getMessage(), t);
43          this.line = line;
44          this.column = column;
45      }
46  
47  
48      public String getMessage() {
49          return super.getMessage() + " at line " + line + ", column " + column;
50      }
51  
52      public int getLine() {
53          return this.line;
54      }
55  
56      public int getColumn() {
57          return this.column;
58      }
59  
60  }