blob: 49beff0d17f4c4ea37f58fc94ecd434e2586e34e [file] [log] [blame]
Bharat saraswal97459962016-02-20 21:57:16 +05301/*
Brian O'Connor0f7908b2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Bharat saraswal97459962016-02-20 21:57:16 +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.translator.tojava;
18
Bharat saraswal4aaab4d2016-05-17 14:19:38 +053019import org.onosproject.yangutils.translator.exception.TranslatorException;
Bharat saraswale50edca2016-08-05 01:58:25 +053020import org.onosproject.yangutils.utils.io.YangPluginConfig;
janani b1c6acc42016-04-15 16:18:30 +053021
Gaurav Agrawal9381ebb2016-09-29 19:00:33 +053022import java.io.IOException;
23
Bharat saraswal97459962016-02-20 21:57:16 +053024/**
Vinod Kumar S9f26ae52016-03-23 15:30:27 +053025 * Abstraction of an entity which provides Code generator functionalities.
Bharat saraswal97459962016-02-20 21:57:16 +053026 */
Vinod Kumar S9f26ae52016-03-23 15:30:27 +053027public interface JavaCodeGenerator {
Bharat saraswal97459962016-02-20 21:57:16 +053028
29 /**
Vinod Kumar S9f26ae52016-03-23 15:30:27 +053030 * Traverse the schema of application and generate corresponding code.
Bharat saraswal97459962016-02-20 21:57:16 +053031 *
janani b1c6acc42016-04-15 16:18:30 +053032 * @param yangPlugin YANG plugin config
Bharat saraswal4aaab4d2016-05-17 14:19:38 +053033 * @throws TranslatorException when fails to translate the data model tree
Bharat saraswal97459962016-02-20 21:57:16 +053034 */
VinodKumarS-Huawei6266db32016-05-10 17:58:57 +053035 void generateCodeEntry(YangPluginConfig yangPlugin)
Bharat saraswal4aaab4d2016-05-17 14:19:38 +053036 throws TranslatorException;
Bharat saraswal97459962016-02-20 21:57:16 +053037
Vinod Kumar S9f26ae52016-03-23 15:30:27 +053038 /**
39 * Traverse the schema of application and generate corresponding code.
40 *
Bharat saraswal4aaab4d2016-05-17 14:19:38 +053041 * @throws TranslatorException when fails to generate java code
Gaurav Agrawal9381ebb2016-09-29 19:00:33 +053042 * @throws IOException a violation in IO rule
Vinod Kumar S9f26ae52016-03-23 15:30:27 +053043 */
VinodKumarS-Huawei6266db32016-05-10 17:58:57 +053044 void generateCodeExit()
Gaurav Agrawal9381ebb2016-09-29 19:00:33 +053045 throws TranslatorException, IOException;
Bharat saraswal97459962016-02-20 21:57:16 +053046}