blob: cd5fa81e8ec008d2ce14c126a2b15f0665b17d05 [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 *
32 * @param attrType data type of the added attribute.
33 * @param name name of the attribute.
34 * @param isListAttr if the current added attribute needs to be maintained
35 * in a list.
36 */
37 void addAttributeInfo(YangType<?> attrType, String name, boolean isListAttr);
38
39 /**
40 * Flushes the cached contents to the target file, frees used resources.
41 *
42 * @throws IOException when failes to generated java files.
43 */
44 void close() throws IOException;
45}