blob: 0d220e5734ed4c371895d89ce5ead3bcb87e808c [file] [log] [blame]
Vinod Kumar S8c4e6492016-02-05 20:21:19 +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;
18
19import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053020import org.onosproject.yangutils.utils.YangConstructType;
Vinod Kumar S8c4e6492016-02-05 20:21:19 +053021
22/**
23 * Abstraction of an entity which process the data of lexer's parse tree.
24 */
25public interface Parsable {
26
27 /**
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053028 * Get the type of YANG construct data.
Vinod Kumar S8c4e6492016-02-05 20:21:19 +053029 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053030 * @return the type of YANG construct data.
Vinod Kumar S8c4e6492016-02-05 20:21:19 +053031 */
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053032 YangConstructType getYangConstructType();
Vinod Kumar S8c4e6492016-02-05 20:21:19 +053033
34 /**
35 * Check if the node is valid as per YANG grammar's syntax and semantics.
36 * This validation will be performed on entering the node in traversal
37 *
38 * @throws DataModelException if there is any violation of the YANG rules
39 * in parsed data, corresponding exception should be thrown
40 */
41 void validateDataOnEntry() throws DataModelException;
42
43 /**
44 * Check if the node is valid as per YANG grammar's syntax and semantics.
45 * This validation will be performed on exiting the node in traversal
46 *
47 * @throws DataModelException if there is any violation of the YANG rules
48 * in parsed data, corresponding exception should be thrown
49 */
50 void validateDataOnExit() throws DataModelException;
51}