blob: 2beae1027ca6445d7095f62c6c23c5bd2352137f [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;
20
21/**
22 * Abstraction of an entity which process the data of lexer's parse tree.
23 */
24public interface Parsable {
25
26 /**
27 * Get the type of parsable data.
28 *
29 * @return the type of parsable data
30 */
31 ParsableDataType getParsableDataType();
32
33 /**
34 * Check if the node is valid as per YANG grammar's syntax and semantics.
35 * This validation will be performed on entering the node in traversal
36 *
37 * @throws DataModelException if there is any violation of the YANG rules
38 * in parsed data, corresponding exception should be thrown
39 */
40 void validateDataOnEntry() throws DataModelException;
41
42 /**
43 * Check if the node is valid as per YANG grammar's syntax and semantics.
44 * This validation will be performed on exiting the node in traversal
45 *
46 * @throws DataModelException if there is any violation of the YANG rules
47 * in parsed data, corresponding exception should be thrown
48 */
49 void validateDataOnExit() throws DataModelException;
50}