Committed by
Gerrit Code Review
[ONOS-3878] parse tree traversal using listener framework
Change-Id: I53c18593281399f83a2b9bf9df2f7261c69c00b2
Showing
5 changed files
with
105 additions
and
0 deletions
utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/TreeWalkListener.java
0 → 100644
This diff is collapsed. Click to expand it.
utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/package-info.java
0 → 100644
1 | +/* | ||
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 | + | ||
17 | +/** | ||
18 | + * Provide call back functions for listeners based tree walk. | ||
19 | + */ | ||
20 | +package org.onosproject.yangutils.parser.impl.listeners; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerError.java
0 → 100644
1 | +/* | ||
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 | + | ||
17 | +package org.onosproject.yangutils.parser.impl.parserutils; | ||
18 | + | ||
19 | +/** | ||
20 | + * Error information while doing a listener's based walk is maintained in it. | ||
21 | + */ | ||
22 | +public 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 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/package-info.java
0 → 100644
1 | +/* | ||
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 | + | ||
17 | +/** | ||
18 | + * Provide common utils for parser implementation. | ||
19 | + */ | ||
20 | +package org.onosproject.yangutils.parser.impl.parserutils; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment