blob: 05754a18143045f0bc15ce75747c4a14f84bb4a5 [file] [log] [blame]
Vinod Kumar S8c4e6492016-02-05 20:21:19 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Vinod Kumar S8c4e6492016-02-05 20:21:19 +05303 *
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 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053028 * Returns 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 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053035 * Checks if the node is valid as per YANG grammar's syntax and semantics.
Vinod Kumar S8c4e6492016-02-05 20:21:19 +053036 * 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 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053044 * Checks if the node is valid as per YANG grammar's syntax and semantics.
Vinod Kumar S8c4e6492016-02-05 20:21:19 +053045 * 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}