blob: 8b2d49f9b8d237f49aa1345be72c7db2e54e69b8 [file] [log] [blame]
Vinod Kumar S38046502016-03-23 15:30:27 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Vinod Kumar S38046502016-03-23 15:30:27 +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
Shankara-Huaweibdf24bb2016-08-02 18:13:13 +053017package org.onosproject.yangutils.datamodel.javadatamodel;
Vinod Kumar S38046502016-03-23 15:30:27 +053018
Bharat saraswal96dfef02016-06-16 00:29:12 +053019import java.io.Serializable;
20
Vinod Kumar S38046502016-03-23 15:30:27 +053021/**
Bharat saraswald9822e92016-04-05 15:13:44 +053022 * Represents cached java file handle, which supports the addition of member attributes and
Vinod Kumar S38046502016-03-23 15:30:27 +053023 * methods.
24 */
Bharat saraswal96dfef02016-06-16 00:29:12 +053025public class JavaFileInfo implements Serializable {
26
27 private static final long serialVersionUID = 806102633L;
Bharat saraswal6ef0b762016-04-05 12:45:45 +053028
Vinod Kumar S38046502016-03-23 15:30:27 +053029 /**
30 * The type(s) of java source file(s) to be generated when the cached file
31 * handle is closed.
32 */
Bharat saraswal96dfef02016-06-16 00:29:12 +053033 private transient int genFileTypes;
Vinod Kumar S38046502016-03-23 15:30:27 +053034
35 /**
36 * Name of the module.
37 */
38 private String javaName;
39
40 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +053041 * Java Package of the mapped java class.
Vinod Kumar S38046502016-03-23 15:30:27 +053042 */
43 private String pkg;
44
45 /**
46 * File generation directory path.
47 */
48 private String relativeFilePath;
49
50 /**
51 * File generation base directory path.
52 */
53 private String codeGenDirFilePath;
54
55 /**
Bharat saraswal33dfa012016-05-17 19:59:16 +053056 * Plugin configuration for naming convention.
57 */
Bharat saraswal96dfef02016-06-16 00:29:12 +053058 private transient YangPluginConfig pluginConfig;
Bharat saraswal33dfa012016-05-17 19:59:16 +053059
60 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053061 * Returns the types of files being generated corresponding to the YANG
Vinod Kumar S38046502016-03-23 15:30:27 +053062 * definition.
63 *
64 * @return the types of files being generated corresponding to the YANG
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +053065 * definition
Vinod Kumar S38046502016-03-23 15:30:27 +053066 */
67 public int getGeneratedFileTypes() {
68 return genFileTypes;
69 }
70
71 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053072 * Sets the types of files being generated corresponding to the YANG
Vinod Kumar S38046502016-03-23 15:30:27 +053073 * definition.
74 *
75 * @param fileTypes the types of files being generated corresponding to the
Shankara-Huaweibdf24bb2016-08-02 18:13:13 +053076 * YANG definition
Vinod Kumar S38046502016-03-23 15:30:27 +053077 */
78 public void setGeneratedFileTypes(int fileTypes) {
79 genFileTypes = fileTypes;
80 }
81
82 /**
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +053083 * Adds the types of files being generated corresponding to the YANG
84 * definition.
85 *
86 * @param fileTypes the types of files being generated corresponding to the
Shankara-Huaweibdf24bb2016-08-02 18:13:13 +053087 * YANG definition
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +053088 */
89 public void addGeneratedFileTypes(int fileTypes) {
90 genFileTypes |= fileTypes;
91 }
92
93 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053094 * Returns the java name of the node.
Vinod Kumar S38046502016-03-23 15:30:27 +053095 *
96 * @return the java name of node
97 */
98 public String getJavaName() {
99 return javaName;
100 }
101
102 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530103 * Sets the java name of the node.
Vinod Kumar S38046502016-03-23 15:30:27 +0530104 *
105 * @param name the java name of node
106 */
107 public void setJavaName(String name) {
108 javaName = name;
109 }
110
111 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530112 * Returns the mapped java package.
Vinod Kumar S38046502016-03-23 15:30:27 +0530113 *
114 * @return the java package
115 */
116 public String getPackage() {
Vinod Kumar S38046502016-03-23 15:30:27 +0530117 return pkg;
118 }
119
120 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530121 * Sets the node's package.
Vinod Kumar S38046502016-03-23 15:30:27 +0530122 *
123 * @param nodePackage node's package
124 */
125 public void setPackage(String nodePackage) {
126 pkg = nodePackage;
127 }
128
129 /**
130 * Sets directory package path for code generation.
131 *
132 * @param path directory package path for code generation
133 */
134 public void setPackageFilePath(String path) {
135 relativeFilePath = path;
136 }
137
138 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530139 * Returns directory package path for code generation.
Vinod Kumar S38046502016-03-23 15:30:27 +0530140 *
141 * @return directory package path for code generation
142 */
143 public String getPackageFilePath() {
144 return relativeFilePath;
145 }
146
147 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530148 * Returns base directory package path for code generation.
Vinod Kumar S38046502016-03-23 15:30:27 +0530149 *
150 * @return directory package path for code generation
151 */
152 public String getBaseCodeGenPath() {
153 return codeGenDirFilePath;
154 }
155
156 /**
157 * Sets base directory package path for code generation.
158 *
159 * @param path base directory path
160 */
161 public void setBaseCodeGenPath(String path) {
162 codeGenDirFilePath = path;
163 }
Bharat saraswal33dfa012016-05-17 19:59:16 +0530164
165 /**
166 * Returns plugin configurations.
167 *
168 * @return the pluginConfig
169 */
170 public YangPluginConfig getPluginConfig() {
171 return pluginConfig;
172 }
173
174 /**
175 * Sets plugin configurations.
176 *
177 * @param pluginConfig the pluginConfig to set
178 */
179 public void setPluginConfig(YangPluginConfig pluginConfig) {
180 this.pluginConfig = pluginConfig;
181 }
Vinod Kumar S38046502016-03-23 15:30:27 +0530182}