blob: d4c8504e5fdd52cece1840fe35556951fb50c327 [file] [log] [blame]
Gaurav Agrawal4f8ad172016-02-12 16:17:32 +05301/*
2 * Copyright 2016 Open Networking Laboratory
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
17package org.onosproject.yangutils.parser.impl.parserutils;
18
19/**
20 * Error information while doing a listener's based walk is maintained in it.
21 */
22public class ListenerError {
23
24 // Maintains the state of Exception.
25 private boolean errorFlag = false;
26
27 // Maintains the reason of Exception.
28 private String errorMsg;
29
30 /**
31 * Returns error flag.
32 *
33 * @return error flag.
34 */
35 public boolean isErrorFlag() {
36 return errorFlag;
37 }
38
39 /**
40 * Returns error message.
41 *
42 * @return error msg.
43 */
44 public String getErrorMsg() {
45 return errorMsg;
46 }
47
48 /**
49 * Set error flag.
50 *
51 * @param errorFlag error existence flag
52 */
53 public void setErrorFlag(boolean errorFlag) {
54 this.errorFlag = errorFlag;
55 }
56
57 /**
58 * Set error message.
59 *
60 * @param errorMsg reason for error.
61 */
62 public void setErrorMsg(String errorMsg) {
63 this.errorMsg = errorMsg;
64 }
65}