blob: 3024a4798c00b99ea563c01e2d0fc0041f7e8c9b [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
17package org.onosproject.yangutils.translator.tojava;
18
19/**
Bharat saraswald9822e92016-04-05 15:13:44 +053020 * Represents cached java file handle, which supports the addition of member attributes and
Vinod Kumar S38046502016-03-23 15:30:27 +053021 * methods.
22 */
23public class JavaFileInfo {
Bharat saraswal6ef0b762016-04-05 12:45:45 +053024
Vinod Kumar S38046502016-03-23 15:30:27 +053025 /**
26 * The type(s) of java source file(s) to be generated when the cached file
27 * handle is closed.
28 */
29 private int genFileTypes;
30
31 /**
32 * Name of the module.
33 */
34 private String javaName;
35
36 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +053037 * Java Package of the mapped java class.
Vinod Kumar S38046502016-03-23 15:30:27 +053038 */
39 private String pkg;
40
41 /**
42 * File generation directory path.
43 */
44 private String relativeFilePath;
45
46 /**
47 * File generation base directory path.
48 */
49 private String codeGenDirFilePath;
50
51 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053052 * Returns the types of files being generated corresponding to the YANG
Vinod Kumar S38046502016-03-23 15:30:27 +053053 * definition.
54 *
55 * @return the types of files being generated corresponding to the YANG
56 * definition
57 */
58 public int getGeneratedFileTypes() {
59 return genFileTypes;
60 }
61
62 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053063 * Sets the types of files being generated corresponding to the YANG
Vinod Kumar S38046502016-03-23 15:30:27 +053064 * definition.
65 *
66 * @param fileTypes the types of files being generated corresponding to the
67 * YANG definition
68 */
69 public void setGeneratedFileTypes(int fileTypes) {
70 genFileTypes = fileTypes;
71 }
72
73 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053074 * Returns the java name of the node.
Vinod Kumar S38046502016-03-23 15:30:27 +053075 *
76 * @return the java name of node
77 */
78 public String getJavaName() {
79 return javaName;
80 }
81
82 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053083 * Sets the java name of the node.
Vinod Kumar S38046502016-03-23 15:30:27 +053084 *
85 * @param name the java name of node
86 */
87 public void setJavaName(String name) {
88 javaName = name;
89 }
90
91 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053092 * Returns the mapped java package.
Vinod Kumar S38046502016-03-23 15:30:27 +053093 *
94 * @return the java package
95 */
96 public String getPackage() {
Vinod Kumar S38046502016-03-23 15:30:27 +053097 return pkg;
98 }
99
100 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530101 * Sets the node's package.
Vinod Kumar S38046502016-03-23 15:30:27 +0530102 *
103 * @param nodePackage node's package
104 */
105 public void setPackage(String nodePackage) {
106 pkg = nodePackage;
107 }
108
109 /**
110 * Sets directory package path for code generation.
111 *
112 * @param path directory package path for code generation
113 */
114 public void setPackageFilePath(String path) {
115 relativeFilePath = path;
116 }
117
118 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530119 * Returns directory package path for code generation.
Vinod Kumar S38046502016-03-23 15:30:27 +0530120 *
121 * @return directory package path for code generation
122 */
123 public String getPackageFilePath() {
124 return relativeFilePath;
125 }
126
127 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530128 * Returns base directory package path for code generation.
Vinod Kumar S38046502016-03-23 15:30:27 +0530129 *
130 * @return directory package path for code generation
131 */
132 public String getBaseCodeGenPath() {
133 return codeGenDirFilePath;
134 }
135
136 /**
137 * Sets base directory package path for code generation.
138 *
139 * @param path base directory path
140 */
141 public void setBaseCodeGenPath(String path) {
142 codeGenDirFilePath = path;
143 }
144}