blob: 4c2f808ae29b066156f174bb0bcacb19a77ee0a2 [file] [log] [blame]
Bharat saraswal870c56f2016-02-20 21:57:16 +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.translator;
18
19import java.io.IOException;
20
21import org.onosproject.yangutils.datamodel.YangType;
22
23/**
24 * Cached java file handle, which supports the addition of member attributes and
25 * methods.
26 */
27public interface CachedFileHandle {
28
29 /**
30 * Add a new attribute to the file(s).
31 *
Vinod Kumar Sc4216002016-03-03 19:55:30 +053032 * @param attrType data type of the added attribute
33 * @param name name of the attribute
Bharat saraswal870c56f2016-02-20 21:57:16 +053034 * @param isListAttr if the current added attribute needs to be maintained
Vinod Kumar Sc4216002016-03-03 19:55:30 +053035 * in a list
Bharat saraswal870c56f2016-02-20 21:57:16 +053036 */
37 void addAttributeInfo(YangType<?> attrType, String name, boolean isListAttr);
38
39 /**
40 * Flushes the cached contents to the target file, frees used resources.
41 *
Vinod Kumar Sc4216002016-03-03 19:55:30 +053042 * @throws IOException when failes to generated java files
Bharat saraswal870c56f2016-02-20 21:57:16 +053043 */
44 void close() throws IOException;
Bharat saraswal594bc6d2016-02-22 22:15:21 +053045
46 /**
Bharat saraswal4bf8b152016-02-25 02:26:43 +053047 * Sets directory package path for code generation.
48 *
49 * @param filePath directory package path for code generation
50 */
Vinod Kumar Sc4216002016-03-03 19:55:30 +053051 void setRelativeFilePath(String filePath);
52
53 /**
54 * Gets directory package path for code generation.
55 *
56 * @return directory package path for code generation
57 */
58 String getRelativeFilePath();
Bharat saraswal870c56f2016-02-20 21:57:16 +053059}