Committed by
Gerrit Code Review
[ONOS-4922] Javamodel package creation for YANG utils.
Change-Id: Iff1745a8c04881b44db3f2f687967f984c38e2c7
Showing
92 changed files
with
1302 additions
and
585 deletions
... | @@ -14,12 +14,10 @@ | ... | @@ -14,12 +14,10 @@ |
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -package org.onosproject.yangutils.translator.tojava; | 17 | +package org.onosproject.yangutils.datamodel.javadatamodel; |
18 | 18 | ||
19 | import java.io.Serializable; | 19 | import java.io.Serializable; |
20 | 20 | ||
21 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
22 | - | ||
23 | /** | 21 | /** |
24 | * Represents cached java file handle, which supports the addition of member attributes and | 22 | * Represents cached java file handle, which supports the addition of member attributes and |
25 | * methods. | 23 | * methods. | ... | ... |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import java.io.Serializable; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents the information about individual imports in the generated file. | ||
23 | + */ | ||
24 | +public class JavaQualifiedTypeInfo | ||
25 | + implements Serializable { | ||
26 | + | ||
27 | + private static final long serialVersionUID = 806201634L; | ||
28 | + | ||
29 | + /** | ||
30 | + * Package location where the imported class/interface is defined. | ||
31 | + */ | ||
32 | + protected String pkgInfo; | ||
33 | + | ||
34 | + /** | ||
35 | + * Class/interface being referenced. | ||
36 | + */ | ||
37 | + protected String classInfo; | ||
38 | + | ||
39 | + /** | ||
40 | + * Returns class info. | ||
41 | + * | ||
42 | + * @return class info | ||
43 | + */ | ||
44 | + public String getClassInfo() { | ||
45 | + return classInfo; | ||
46 | + } | ||
47 | + | ||
48 | + /** | ||
49 | + * Returns package info. | ||
50 | + * | ||
51 | + * @return package info | ||
52 | + */ | ||
53 | + public String getPkgInfo() { | ||
54 | + return pkgInfo; | ||
55 | + } | ||
56 | + | ||
57 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangAugment; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java augment. | ||
23 | + */ | ||
24 | +public class YangJavaAugment extends YangAugment { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201601L; | ||
27 | + | ||
28 | + protected JavaFileInfo javaFileInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java file info. | ||
32 | + * | ||
33 | + * @return java file info | ||
34 | + */ | ||
35 | + public JavaFileInfo getJavaFileInfo() { | ||
36 | + return javaFileInfo; | ||
37 | + } | ||
38 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangCase; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java case. | ||
23 | + */ | ||
24 | +public class YangJavaCase extends YangCase { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201602L; | ||
27 | + | ||
28 | + protected JavaFileInfo javaFileInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java file info. | ||
32 | + * | ||
33 | + * @return java file info | ||
34 | + */ | ||
35 | + public JavaFileInfo getJavaFileInfo() { | ||
36 | + return javaFileInfo; | ||
37 | + } | ||
38 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangChoice; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java choice. | ||
23 | + */ | ||
24 | +public class YangJavaChoice extends YangChoice { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201603L; | ||
27 | + | ||
28 | + protected JavaFileInfo javaFileInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java file info. | ||
32 | + * | ||
33 | + * @return java file info | ||
34 | + */ | ||
35 | + public JavaFileInfo getJavaFileInfo() { | ||
36 | + return javaFileInfo; | ||
37 | + } | ||
38 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangContainer; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java container. | ||
23 | + */ | ||
24 | +public class YangJavaContainer extends YangContainer { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201604L; | ||
27 | + | ||
28 | + protected JavaFileInfo javaFileInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java file info. | ||
32 | + * | ||
33 | + * @return java file info | ||
34 | + */ | ||
35 | + public JavaFileInfo getJavaFileInfo() { | ||
36 | + return javaFileInfo; | ||
37 | + } | ||
38 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangEnumeration; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java enumeration. | ||
23 | + */ | ||
24 | +public class YangJavaEnumeration extends YangEnumeration { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201605L; | ||
27 | + | ||
28 | + protected JavaFileInfo javaFileInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java file info. | ||
32 | + * | ||
33 | + * @return java file info | ||
34 | + */ | ||
35 | + public JavaFileInfo getJavaFileInfo() { | ||
36 | + return javaFileInfo; | ||
37 | + } | ||
38 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangGrouping; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java grouping. | ||
23 | + */ | ||
24 | +public class YangJavaGrouping extends YangGrouping { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201606L; | ||
27 | + | ||
28 | + protected JavaFileInfo javaFileInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java file info. | ||
32 | + * | ||
33 | + * @return java file info | ||
34 | + */ | ||
35 | + public JavaFileInfo getJavaFileInfo() { | ||
36 | + return javaFileInfo; | ||
37 | + } | ||
38 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangIdentity; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java identity. | ||
23 | + */ | ||
24 | +public class YangJavaIdentity extends YangIdentity { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201616L; | ||
27 | + | ||
28 | + protected JavaFileInfo javaFileInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java file info. | ||
32 | + * | ||
33 | + * @return java file info | ||
34 | + */ | ||
35 | + public JavaFileInfo getJavaFileInfo() { | ||
36 | + return javaFileInfo; | ||
37 | + } | ||
38 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangInput; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java input. | ||
23 | + */ | ||
24 | +public class YangJavaInput extends YangInput { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201607L; | ||
27 | + | ||
28 | + protected JavaFileInfo javaFileInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java file info. | ||
32 | + * | ||
33 | + * @return java file info | ||
34 | + */ | ||
35 | + public JavaFileInfo getJavaFileInfo() { | ||
36 | + return javaFileInfo; | ||
37 | + } | ||
38 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangLeaf; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represent YANG java leaf. | ||
23 | + */ | ||
24 | +public class YangJavaLeaf extends YangLeaf { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201617L; | ||
27 | + | ||
28 | + protected JavaQualifiedTypeInfo javaQualifiedTypeInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java qualified type info. | ||
32 | + * | ||
33 | + * @return java qualified type info | ||
34 | + */ | ||
35 | + public JavaQualifiedTypeInfo getJavaQualifiedTypeInfo() { | ||
36 | + return javaQualifiedTypeInfo; | ||
37 | + } | ||
38 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangLeafList; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java leaf list. | ||
23 | + */ | ||
24 | +public class YangJavaLeafList extends YangLeafList { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201618L; | ||
27 | + | ||
28 | + protected JavaQualifiedTypeInfo javaQualifiedTypeInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java qualified type info. | ||
32 | + * | ||
33 | + * @return java qualified type info | ||
34 | + */ | ||
35 | + public JavaQualifiedTypeInfo getJavaQualifiedTypeInfo() { | ||
36 | + return javaQualifiedTypeInfo; | ||
37 | + } | ||
38 | +} |
... | @@ -13,25 +13,30 @@ | ... | @@ -13,25 +13,30 @@ |
13 | * See the License for the specific language governing permissions and | 13 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | -package org.onosproject.yangutils.translator.tojava; | 16 | + |
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangList; | ||
17 | 20 | ||
18 | /** | 21 | /** |
19 | - * Represents the information of the java import data. | 22 | + * Represent YANG java list. |
20 | */ | 23 | */ |
21 | -public interface JavaImportDataContainer { | 24 | +public class YangJavaList extends YangList { |
25 | + | ||
26 | + private static final long serialVersionUID = 208201608L; | ||
22 | 27 | ||
23 | /** | 28 | /** |
24 | - * Returns the data of java imports to be included in generated file. | 29 | + * Contains the information of the java file being generated. |
25 | - * | ||
26 | - * @return data of java imports to be included in generated file | ||
27 | */ | 30 | */ |
28 | - JavaImportData getJavaImportData(); | 31 | + protected JavaFileInfo javaFileInfo; |
29 | 32 | ||
30 | /** | 33 | /** |
31 | - * Sets the data of java imports to be included in generated file. | 34 | + * Returns java file info. |
32 | * | 35 | * |
33 | - * @param javaImportData data of java imports to be included in generated | 36 | + * @return java file info |
34 | - * file | ||
35 | */ | 37 | */ |
36 | - void setJavaImportData(JavaImportData javaImportData); | 38 | + public JavaFileInfo getJavaFileInfo() { |
39 | + return javaFileInfo; | ||
40 | + } | ||
41 | + | ||
37 | } | 42 | } | ... | ... |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangModule; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java module. | ||
23 | + */ | ||
24 | +public class YangJavaModule extends YangModule { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201609L; | ||
27 | + | ||
28 | + protected JavaFileInfo javaFileInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java file info. | ||
32 | + * | ||
33 | + * @return java file info | ||
34 | + */ | ||
35 | + public JavaFileInfo getJavaFileInfo() { | ||
36 | + return javaFileInfo; | ||
37 | + } | ||
38 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangNotification; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java notification. | ||
23 | + */ | ||
24 | +public class YangJavaNotification extends YangNotification { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201610L; | ||
27 | + | ||
28 | + protected JavaFileInfo javaFileInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java file info. | ||
32 | + * | ||
33 | + * @return java file info | ||
34 | + */ | ||
35 | + public JavaFileInfo getJavaFileInfo() { | ||
36 | + return javaFileInfo; | ||
37 | + } | ||
38 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangOutput; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java output. | ||
23 | + */ | ||
24 | +public class YangJavaOutput extends YangOutput { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201611L; | ||
27 | + | ||
28 | + protected JavaFileInfo javaFileInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java file info. | ||
32 | + * | ||
33 | + * @return java file info | ||
34 | + */ | ||
35 | + public JavaFileInfo getJavaFileInfo() { | ||
36 | + return javaFileInfo; | ||
37 | + } | ||
38 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangRpc; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java rpc. | ||
23 | + */ | ||
24 | +public class YangJavaRpc extends YangRpc { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201612L; | ||
27 | + | ||
28 | + protected JavaFileInfo javaFileInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java file info. | ||
32 | + * | ||
33 | + * @return java file info | ||
34 | + */ | ||
35 | + public JavaFileInfo getJavaFileInfo() { | ||
36 | + return javaFileInfo; | ||
37 | + } | ||
38 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangSubModule; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java submodule. | ||
23 | + */ | ||
24 | +public class YangJavaSubModule extends YangSubModule { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201612L; | ||
27 | + | ||
28 | + protected JavaFileInfo javaFileInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java file info. | ||
32 | + * | ||
33 | + * @return java file info | ||
34 | + */ | ||
35 | + public JavaFileInfo getJavaFileInfo() { | ||
36 | + return javaFileInfo; | ||
37 | + } | ||
38 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangType; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java type. | ||
23 | + */ | ||
24 | +public class YangJavaType extends YangType { | ||
25 | + | ||
26 | + protected JavaQualifiedTypeInfo javaQualifiedTypeInfo; | ||
27 | + | ||
28 | + /** | ||
29 | + * Returns java qualified type info. | ||
30 | + * | ||
31 | + * @return java qualified type info | ||
32 | + */ | ||
33 | + public JavaQualifiedTypeInfo getJavaQualifiedTypeInfo() { | ||
34 | + return javaQualifiedTypeInfo; | ||
35 | + } | ||
36 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangTypeDef; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represents YANG java typedef. | ||
23 | + */ | ||
24 | +public class YangJavaTypeDef extends YangTypeDef { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201613L; | ||
27 | + | ||
28 | + protected JavaFileInfo javaFileInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java file info. | ||
32 | + * | ||
33 | + * @return java file info | ||
34 | + */ | ||
35 | + public JavaFileInfo getJavaFileInfo() { | ||
36 | + return javaFileInfo; | ||
37 | + } | ||
38 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangUnion; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represent YANG java union. | ||
23 | + */ | ||
24 | +public class YangJavaUnion extends YangUnion { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201614L; | ||
27 | + protected JavaFileInfo javaFileInfo; | ||
28 | + | ||
29 | + /** | ||
30 | + * Returns java file info. | ||
31 | + * | ||
32 | + * @return java file info | ||
33 | + */ | ||
34 | + public JavaFileInfo getJavaFileInfo() { | ||
35 | + return javaFileInfo; | ||
36 | + } | ||
37 | +} |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.javadatamodel; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.datamodel.YangUses; | ||
20 | + | ||
21 | +/** | ||
22 | + * Represent YANG java uses. | ||
23 | + */ | ||
24 | +public class YangJavaUses extends YangUses { | ||
25 | + | ||
26 | + private static final long serialVersionUID = 208201615L; | ||
27 | + | ||
28 | + protected JavaFileInfo javaFileInfo; | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns java file info. | ||
32 | + * | ||
33 | + * @return java file info | ||
34 | + */ | ||
35 | + public JavaFileInfo getJavaFileInfo() { | ||
36 | + return javaFileInfo; | ||
37 | + } | ||
38 | +} |
... | @@ -14,7 +14,7 @@ | ... | @@ -14,7 +14,7 @@ |
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -package org.onosproject.yangutils.utils.io.impl; | 17 | +package org.onosproject.yangutils.datamodel.javadatamodel; |
18 | 18 | ||
19 | /** | 19 | /** |
20 | * Representation of plugin configurations required for YANG utils. | 20 | * Representation of plugin configurations required for YANG utils. | ... | ... |
... | @@ -14,7 +14,7 @@ | ... | @@ -14,7 +14,7 @@ |
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -package org.onosproject.yangutils.utils.io.impl; | 17 | +package org.onosproject.yangutils.datamodel.javadatamodel; |
18 | 18 | ||
19 | /** | 19 | /** |
20 | * Representation of YANG to java naming conflict resolver util. | 20 | * Representation of YANG to java naming conflict resolver util. | ... | ... |
1 | +/* | ||
2 | + * Copyright 2016-present 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 | + | ||
17 | +/** | ||
18 | + * Representation of YANG java data model. | ||
19 | + */ | ||
20 | +package org.onosproject.yangutils.datamodel.javadatamodel; |
... | @@ -39,8 +39,8 @@ import org.onosproject.yangutils.parser.YangUtilsParser; | ... | @@ -39,8 +39,8 @@ import org.onosproject.yangutils.parser.YangUtilsParser; |
39 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 39 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
40 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; | 40 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; |
41 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; | 41 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; |
42 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 42 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
43 | -import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil; | 43 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangToJavaNamingConflictUtil; |
44 | import org.sonatype.plexus.build.incremental.BuildContext; | 44 | import org.sonatype.plexus.build.incremental.BuildContext; |
45 | 45 | ||
46 | import static org.apache.maven.plugins.annotations.LifecyclePhase.GENERATE_SOURCES; | 46 | import static org.apache.maven.plugins.annotations.LifecyclePhase.GENERATE_SOURCES; | ... | ... |
... | @@ -48,7 +48,7 @@ public final class JavaAttributeInfo { | ... | @@ -48,7 +48,7 @@ public final class JavaAttributeInfo { |
48 | * The class info will be used to set the attribute type and package info | 48 | * The class info will be used to set the attribute type and package info |
49 | * will be use for qualified name. | 49 | * will be use for qualified name. |
50 | */ | 50 | */ |
51 | - private JavaQualifiedTypeInfo importInfo; | 51 | + private JavaQualifiedTypeInfoTranslator importInfo; |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * If conflict occurs. | 54 | * If conflict occurs. |
... | @@ -139,7 +139,7 @@ public final class JavaAttributeInfo { | ... | @@ -139,7 +139,7 @@ public final class JavaAttributeInfo { |
139 | * | 139 | * |
140 | * @param isList if the added attribute is a list of info | 140 | * @param isList if the added attribute is a list of info |
141 | */ | 141 | */ |
142 | - public void setListAttr(boolean isList) { | 142 | + private void setListAttr(boolean isList) { |
143 | isListAttr = isList; | 143 | isListAttr = isList; |
144 | } | 144 | } |
145 | 145 | ||
... | @@ -161,7 +161,7 @@ public final class JavaAttributeInfo { | ... | @@ -161,7 +161,7 @@ public final class JavaAttributeInfo { |
161 | * @param isQualified if the added attribute has to be accessed in a fully | 161 | * @param isQualified if the added attribute has to be accessed in a fully |
162 | * qualified manner | 162 | * qualified manner |
163 | */ | 163 | */ |
164 | - public void setIsQualifiedAccess(boolean isQualified) { | 164 | + private void setIsQualifiedAccess(boolean isQualified) { |
165 | isQualifiedName = isQualified; | 165 | isQualifiedName = isQualified; |
166 | } | 166 | } |
167 | 167 | ||
... | @@ -171,7 +171,7 @@ public final class JavaAttributeInfo { | ... | @@ -171,7 +171,7 @@ public final class JavaAttributeInfo { |
171 | * | 171 | * |
172 | * @return import info | 172 | * @return import info |
173 | */ | 173 | */ |
174 | - public JavaQualifiedTypeInfo getImportInfo() { | 174 | + public JavaQualifiedTypeInfoTranslator getImportInfo() { |
175 | return importInfo; | 175 | return importInfo; |
176 | } | 176 | } |
177 | 177 | ||
... | @@ -180,43 +180,43 @@ public final class JavaAttributeInfo { | ... | @@ -180,43 +180,43 @@ public final class JavaAttributeInfo { |
180 | * | 180 | * |
181 | * @param importInfo import info for the attribute type | 181 | * @param importInfo import info for the attribute type |
182 | */ | 182 | */ |
183 | - public void setImportInfo(JavaQualifiedTypeInfo importInfo) { | 183 | + public void setImportInfo(JavaQualifiedTypeInfoTranslator importInfo) { |
184 | this.importInfo = importInfo; | 184 | this.importInfo = importInfo; |
185 | } | 185 | } |
186 | 186 | ||
187 | /** | 187 | /** |
188 | - * Returns true if conflict between int and uint. | 188 | + * Returns true if conflict between int and uInt. |
189 | * | 189 | * |
190 | - * @return true if conflict between int and uint | 190 | + * @return true if conflict between int and uInt |
191 | */ | 191 | */ |
192 | public boolean isIntConflict() { | 192 | public boolean isIntConflict() { |
193 | return isIntConflict; | 193 | return isIntConflict; |
194 | } | 194 | } |
195 | 195 | ||
196 | /** | 196 | /** |
197 | - * Sets true if conflict between int and uint. | 197 | + * Sets true if conflict between int and uInt. |
198 | * | 198 | * |
199 | - * @param intConflict true if conflict between int and uint | 199 | + * @param intConflict true if conflict between int and uInt |
200 | */ | 200 | */ |
201 | - public void setIntConflict(boolean intConflict) { | 201 | + void setIntConflict(boolean intConflict) { |
202 | isIntConflict = intConflict; | 202 | isIntConflict = intConflict; |
203 | } | 203 | } |
204 | 204 | ||
205 | /** | 205 | /** |
206 | - * Returns true if conflict between long and ulong. | 206 | + * Returns true if conflict between long and uLong. |
207 | * | 207 | * |
208 | - * @return true if conflict between long and ulong | 208 | + * @return true if conflict between long and uLong |
209 | */ | 209 | */ |
210 | public boolean isLongConflict() { | 210 | public boolean isLongConflict() { |
211 | return isLongConflict; | 211 | return isLongConflict; |
212 | } | 212 | } |
213 | 213 | ||
214 | /** | 214 | /** |
215 | - * Sets true if conflict between long and ulong. | 215 | + * Sets true if conflict between long and uLong. |
216 | * | 216 | * |
217 | - * @param longConflict true if conflict between long and ulong | 217 | + * @param longConflict true if conflict between long and uLong |
218 | */ | 218 | */ |
219 | - public void setLongConflict(boolean longConflict) { | 219 | + void setLongConflict(boolean longConflict) { |
220 | isLongConflict = longConflict; | 220 | isLongConflict = longConflict; |
221 | } | 221 | } |
222 | 222 | ||
... | @@ -230,7 +230,8 @@ public final class JavaAttributeInfo { | ... | @@ -230,7 +230,8 @@ public final class JavaAttributeInfo { |
230 | * @param isListAttribute is list attribute | 230 | * @param isListAttribute is list attribute |
231 | * @return java attribute info. | 231 | * @return java attribute info. |
232 | */ | 232 | */ |
233 | - public static JavaAttributeInfo getAttributeInfoForTheData(JavaQualifiedTypeInfo importInfo, String attributeName, | 233 | + public static JavaAttributeInfo getAttributeInfoForTheData(JavaQualifiedTypeInfoTranslator importInfo, |
234 | + String attributeName, | ||
234 | YangType<?> attributeType, boolean isQualifiedAccess, | 235 | YangType<?> attributeType, boolean isQualifiedAccess, |
235 | boolean isListAttribute) { | 236 | boolean isListAttribute) { |
236 | 237 | ... | ... |
... | @@ -17,7 +17,7 @@ | ... | @@ -17,7 +17,7 @@ |
17 | package org.onosproject.yangutils.translator.tojava; | 17 | package org.onosproject.yangutils.translator.tojava; |
18 | 18 | ||
19 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 19 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
20 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 20 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
21 | 21 | ||
22 | /** | 22 | /** |
23 | * Abstraction of an entity which provides Code generator functionalities. | 23 | * Abstraction of an entity which provides Code generator functionalities. | ... | ... |
... | @@ -20,9 +20,10 @@ import java.io.IOException; | ... | @@ -20,9 +20,10 @@ import java.io.IOException; |
20 | 20 | ||
21 | import org.onosproject.yangutils.datamodel.TraversalType; | 21 | import org.onosproject.yangutils.datamodel.TraversalType; |
22 | import org.onosproject.yangutils.datamodel.YangNode; | 22 | import org.onosproject.yangutils.datamodel.YangNode; |
23 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; | ||
23 | import org.onosproject.yangutils.translator.exception.InvalidNodeForTranslatorException; | 24 | import org.onosproject.yangutils.translator.exception.InvalidNodeForTranslatorException; |
24 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 25 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
25 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 26 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
26 | 27 | ||
27 | import static org.onosproject.yangutils.datamodel.TraversalType.CHILD; | 28 | import static org.onosproject.yangutils.datamodel.TraversalType.CHILD; |
28 | import static org.onosproject.yangutils.datamodel.TraversalType.PARENT; | 29 | import static org.onosproject.yangutils.datamodel.TraversalType.PARENT; | ... | ... |
... | @@ -15,6 +15,8 @@ | ... | @@ -15,6 +15,8 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.yangutils.translator.tojava; | 16 | package org.onosproject.yangutils.translator.tojava; |
17 | 17 | ||
18 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; | ||
19 | + | ||
18 | /** | 20 | /** |
19 | * Represents data model nodes which are required to generate java classes, need to support | 21 | * Represents data model nodes which are required to generate java classes, need to support |
20 | * java file info. | 22 | * java file info. | ... | ... |
utils/yangutils/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java
... | @@ -22,8 +22,7 @@ import java.util.TreeSet; | ... | @@ -22,8 +22,7 @@ import java.util.TreeSet; |
22 | 22 | ||
23 | import static org.onosproject.yangutils.utils.UtilConstants.ABSTRACT_EVENT; | 23 | import static org.onosproject.yangutils.utils.UtilConstants.ABSTRACT_EVENT; |
24 | import static org.onosproject.yangutils.utils.UtilConstants.BIG_INTEGER; | 24 | import static org.onosproject.yangutils.utils.UtilConstants.BIG_INTEGER; |
25 | -import static org.onosproject.yangutils.utils.UtilConstants.YANG_AUGMENTED_INFO_CLASS_IMPORT_CLASS; | 25 | +import static org.onosproject.yangutils.utils.UtilConstants.BITSET; |
26 | -import static org.onosproject.yangutils.utils.UtilConstants.YANG_AUGMENTED_INFO_CLASS_IMPORT_PKG; | ||
27 | import static org.onosproject.yangutils.utils.UtilConstants.COLLECTION_IMPORTS; | 26 | import static org.onosproject.yangutils.utils.UtilConstants.COLLECTION_IMPORTS; |
28 | import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING; | 27 | import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING; |
29 | import static org.onosproject.yangutils.utils.UtilConstants.EVENT_LISTENER; | 28 | import static org.onosproject.yangutils.utils.UtilConstants.EVENT_LISTENER; |
... | @@ -34,7 +33,6 @@ import static org.onosproject.yangutils.utils.UtilConstants.IMPORT; | ... | @@ -34,7 +33,6 @@ import static org.onosproject.yangutils.utils.UtilConstants.IMPORT; |
34 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_LANG; | 33 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_LANG; |
35 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_MATH; | 34 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_MATH; |
36 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_UTIL_OBJECTS_IMPORT_CLASS; | 35 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_UTIL_OBJECTS_IMPORT_CLASS; |
37 | -import static org.onosproject.yangutils.utils.UtilConstants.BITSET; | ||
38 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_UTIL_OBJECTS_IMPORT_PKG; | 36 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_UTIL_OBJECTS_IMPORT_PKG; |
39 | import static org.onosproject.yangutils.utils.UtilConstants.LIST; | 37 | import static org.onosproject.yangutils.utils.UtilConstants.LIST; |
40 | import static org.onosproject.yangutils.utils.UtilConstants.LISTENER_REG; | 38 | import static org.onosproject.yangutils.utils.UtilConstants.LISTENER_REG; |
... | @@ -44,6 +42,8 @@ import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE; | ... | @@ -44,6 +42,8 @@ import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE; |
44 | import static org.onosproject.yangutils.utils.UtilConstants.ONOS_EVENT_PKG; | 42 | import static org.onosproject.yangutils.utils.UtilConstants.ONOS_EVENT_PKG; |
45 | import static org.onosproject.yangutils.utils.UtilConstants.PERIOD; | 43 | import static org.onosproject.yangutils.utils.UtilConstants.PERIOD; |
46 | import static org.onosproject.yangutils.utils.UtilConstants.SEMI_COLAN; | 44 | import static org.onosproject.yangutils.utils.UtilConstants.SEMI_COLAN; |
45 | +import static org.onosproject.yangutils.utils.UtilConstants.YANG_AUGMENTED_INFO_CLASS_IMPORT_CLASS; | ||
46 | +import static org.onosproject.yangutils.utils.UtilConstants.YANG_AUGMENTED_INFO_CLASS_IMPORT_PKG; | ||
47 | import static org.onosproject.yangutils.utils.UtilConstants.YANG_AUGMENTED_OP_PARAM_INFO_CLASS; | 47 | import static org.onosproject.yangutils.utils.UtilConstants.YANG_AUGMENTED_OP_PARAM_INFO_CLASS; |
48 | import static java.util.Collections.sort; | 48 | import static java.util.Collections.sort; |
49 | 49 | ||
... | @@ -61,13 +61,13 @@ public class JavaImportData { | ... | @@ -61,13 +61,13 @@ public class JavaImportData { |
61 | * Sorted set of import info, to be used to maintain the set of classes to | 61 | * Sorted set of import info, to be used to maintain the set of classes to |
62 | * be imported in the generated class. | 62 | * be imported in the generated class. |
63 | */ | 63 | */ |
64 | - private SortedSet<JavaQualifiedTypeInfo> importSet; | 64 | + private SortedSet<JavaQualifiedTypeInfoTranslator> importSet; |
65 | 65 | ||
66 | /** | 66 | /** |
67 | * Creates java import data object. | 67 | * Creates java import data object. |
68 | */ | 68 | */ |
69 | public JavaImportData() { | 69 | public JavaImportData() { |
70 | - setImportSet(new TreeSet<JavaQualifiedTypeInfo>()); | 70 | + setImportSet(new TreeSet<>()); |
71 | } | 71 | } |
72 | 72 | ||
73 | /** | 73 | /** |
... | @@ -75,7 +75,7 @@ public class JavaImportData { | ... | @@ -75,7 +75,7 @@ public class JavaImportData { |
75 | * | 75 | * |
76 | * @return true if any of the attribute needs to be maintained as a list | 76 | * @return true if any of the attribute needs to be maintained as a list |
77 | */ | 77 | */ |
78 | - public boolean getIfListImported() { | 78 | + private boolean getIfListImported() { |
79 | return isListToImport; | 79 | return isListToImport; |
80 | } | 80 | } |
81 | 81 | ||
... | @@ -84,7 +84,7 @@ public class JavaImportData { | ... | @@ -84,7 +84,7 @@ public class JavaImportData { |
84 | * | 84 | * |
85 | * @param isList status to mention list is bing imported | 85 | * @param isList status to mention list is bing imported |
86 | */ | 86 | */ |
87 | - public void setIfListImported(boolean isList) { | 87 | + void setIfListImported(boolean isList) { |
88 | isListToImport = isList; | 88 | isListToImport = isList; |
89 | } | 89 | } |
90 | 90 | ||
... | @@ -93,7 +93,7 @@ public class JavaImportData { | ... | @@ -93,7 +93,7 @@ public class JavaImportData { |
93 | * | 93 | * |
94 | * @return the set containing the imported class/interface info | 94 | * @return the set containing the imported class/interface info |
95 | */ | 95 | */ |
96 | - public SortedSet<JavaQualifiedTypeInfo> getImportSet() { | 96 | + public SortedSet<JavaQualifiedTypeInfoTranslator> getImportSet() { |
97 | return importSet; | 97 | return importSet; |
98 | } | 98 | } |
99 | 99 | ||
... | @@ -102,14 +102,14 @@ public class JavaImportData { | ... | @@ -102,14 +102,14 @@ public class JavaImportData { |
102 | * | 102 | * |
103 | * @param importSet the set containing the imported class/interface info | 103 | * @param importSet the set containing the imported class/interface info |
104 | */ | 104 | */ |
105 | - private void setImportSet(SortedSet<JavaQualifiedTypeInfo> importSet) { | 105 | + private void setImportSet(SortedSet<JavaQualifiedTypeInfoTranslator> importSet) { |
106 | this.importSet = importSet; | 106 | this.importSet = importSet; |
107 | } | 107 | } |
108 | 108 | ||
109 | /** | 109 | /** |
110 | * Adds an imported class/interface info if it is not already part of the | 110 | * Adds an imported class/interface info if it is not already part of the |
111 | * collection. | 111 | * collection. |
112 | - * | 112 | + * <p> |
113 | * If already part of the collection, check if the packages are same, if so | 113 | * If already part of the collection, check if the packages are same, if so |
114 | * then return true, to denote it is already in the import collection, and | 114 | * then return true, to denote it is already in the import collection, and |
115 | * it can be accessed without qualified access. If the packages do not | 115 | * it can be accessed without qualified access. If the packages do not |
... | @@ -122,7 +122,7 @@ public class JavaImportData { | ... | @@ -122,7 +122,7 @@ public class JavaImportData { |
122 | * @param classPkg generated class package | 122 | * @param classPkg generated class package |
123 | * @return qualified access status of the import node being added | 123 | * @return qualified access status of the import node being added |
124 | */ | 124 | */ |
125 | - public boolean addImportInfo(JavaQualifiedTypeInfo newImportInfo, | 125 | + public boolean addImportInfo(JavaQualifiedTypeInfoTranslator newImportInfo, |
126 | String className, String classPkg) { | 126 | String className, String classPkg) { |
127 | 127 | ||
128 | if (newImportInfo.getClassInfo().contentEquals(className)) { | 128 | if (newImportInfo.getClassInfo().contentEquals(className)) { |
... | @@ -144,14 +144,14 @@ public class JavaImportData { | ... | @@ -144,14 +144,14 @@ public class JavaImportData { |
144 | * qualified access. | 144 | * qualified access. |
145 | */ | 145 | */ |
146 | if (newImportInfo.getPkgInfo().contentEquals(classPkg)) { | 146 | if (newImportInfo.getPkgInfo().contentEquals(classPkg)) { |
147 | - /** | 147 | + /* |
148 | * Package of the referred attribute and the generated class is same, so no need import | 148 | * Package of the referred attribute and the generated class is same, so no need import |
149 | * or qualified access. | 149 | * or qualified access. |
150 | */ | 150 | */ |
151 | return false; | 151 | return false; |
152 | } | 152 | } |
153 | 153 | ||
154 | - for (JavaQualifiedTypeInfo curImportInfo : getImportSet()) { | 154 | + for (JavaQualifiedTypeInfoTranslator curImportInfo : getImportSet()) { |
155 | if (curImportInfo.getClassInfo() | 155 | if (curImportInfo.getClassInfo() |
156 | .contentEquals(newImportInfo.getClassInfo())) { | 156 | .contentEquals(newImportInfo.getClassInfo())) { |
157 | return !curImportInfo.getPkgInfo() | 157 | return !curImportInfo.getPkgInfo() |
... | @@ -176,7 +176,7 @@ public class JavaImportData { | ... | @@ -176,7 +176,7 @@ public class JavaImportData { |
176 | String importString; | 176 | String importString; |
177 | List<String> imports = new ArrayList<>(); | 177 | List<String> imports = new ArrayList<>(); |
178 | 178 | ||
179 | - for (JavaQualifiedTypeInfo importInfo : getImportSet()) { | 179 | + for (JavaQualifiedTypeInfoTranslator importInfo : getImportSet()) { |
180 | if (!importInfo.getPkgInfo().equals(EMPTY_STRING) && importInfo.getClassInfo() != null | 180 | if (!importInfo.getPkgInfo().equals(EMPTY_STRING) && importInfo.getClassInfo() != null |
181 | && !importInfo.getPkgInfo().equals(JAVA_LANG)) { | 181 | && !importInfo.getPkgInfo().equals(JAVA_LANG)) { |
182 | importString = IMPORT + importInfo.getPkgInfo() + PERIOD + importInfo.getClassInfo() + SEMI_COLAN | 182 | importString = IMPORT + importInfo.getPkgInfo() + PERIOD + importInfo.getClassInfo() + SEMI_COLAN |
... | @@ -199,7 +199,7 @@ public class JavaImportData { | ... | @@ -199,7 +199,7 @@ public class JavaImportData { |
199 | * | 199 | * |
200 | * @return import for hash and equals method | 200 | * @return import for hash and equals method |
201 | */ | 201 | */ |
202 | - public String getImportForHashAndEquals() { | 202 | + String getImportForHashAndEquals() { |
203 | return IMPORT + JAVA_UTIL_OBJECTS_IMPORT_PKG + PERIOD + JAVA_UTIL_OBJECTS_IMPORT_CLASS; | 203 | return IMPORT + JAVA_UTIL_OBJECTS_IMPORT_PKG + PERIOD + JAVA_UTIL_OBJECTS_IMPORT_CLASS; |
204 | } | 204 | } |
205 | 205 | ||
... | @@ -208,7 +208,7 @@ public class JavaImportData { | ... | @@ -208,7 +208,7 @@ public class JavaImportData { |
208 | * | 208 | * |
209 | * @return import for to string method | 209 | * @return import for to string method |
210 | */ | 210 | */ |
211 | - public String getImportForToString() { | 211 | + String getImportForToString() { |
212 | return IMPORT + GOOGLE_MORE_OBJECT_IMPORT_PKG + PERIOD + GOOGLE_MORE_OBJECT_IMPORT_CLASS; | 212 | return IMPORT + GOOGLE_MORE_OBJECT_IMPORT_PKG + PERIOD + GOOGLE_MORE_OBJECT_IMPORT_CLASS; |
213 | } | 213 | } |
214 | 214 | ||
... | @@ -217,7 +217,7 @@ public class JavaImportData { | ... | @@ -217,7 +217,7 @@ public class JavaImportData { |
217 | * | 217 | * |
218 | * @return import for to bitset method | 218 | * @return import for to bitset method |
219 | */ | 219 | */ |
220 | - public String getImportForToBitSet() { | 220 | + String getImportForToBitSet() { |
221 | return IMPORT + JAVA_UTIL_OBJECTS_IMPORT_PKG + PERIOD + BITSET + SEMI_COLAN + NEW_LINE; | 221 | return IMPORT + JAVA_UTIL_OBJECTS_IMPORT_PKG + PERIOD + BITSET + SEMI_COLAN + NEW_LINE; |
222 | } | 222 | } |
223 | 223 | ||
... | @@ -226,7 +226,7 @@ public class JavaImportData { | ... | @@ -226,7 +226,7 @@ public class JavaImportData { |
226 | * | 226 | * |
227 | * @return import for list attribute | 227 | * @return import for list attribute |
228 | */ | 228 | */ |
229 | - public String getImportForList() { | 229 | + private String getImportForList() { |
230 | return IMPORT + COLLECTION_IMPORTS + PERIOD + LIST + SEMI_COLAN + NEW_LINE; | 230 | return IMPORT + COLLECTION_IMPORTS + PERIOD + LIST + SEMI_COLAN + NEW_LINE; |
231 | } | 231 | } |
232 | 232 | ||
... | @@ -253,7 +253,7 @@ public class JavaImportData { | ... | @@ -253,7 +253,7 @@ public class JavaImportData { |
253 | * | 253 | * |
254 | * @return import string for AbstractEvent class | 254 | * @return import string for AbstractEvent class |
255 | */ | 255 | */ |
256 | - public String getAbstractEventsImport() { | 256 | + String getAbstractEventsImport() { |
257 | return IMPORT + ONOS_EVENT_PKG + PERIOD + ABSTRACT_EVENT + SEMI_COLAN + NEW_LINE; | 257 | return IMPORT + ONOS_EVENT_PKG + PERIOD + ABSTRACT_EVENT + SEMI_COLAN + NEW_LINE; |
258 | } | 258 | } |
259 | 259 | ||
... | @@ -262,7 +262,7 @@ public class JavaImportData { | ... | @@ -262,7 +262,7 @@ public class JavaImportData { |
262 | * | 262 | * |
263 | * @return import string for EventListener class | 263 | * @return import string for EventListener class |
264 | */ | 264 | */ |
265 | - public String getEventListenerImport() { | 265 | + String getEventListenerImport() { |
266 | return IMPORT + ONOS_EVENT_PKG + PERIOD + EVENT_LISTENER + SEMI_COLAN + NEW_LINE; | 266 | return IMPORT + ONOS_EVENT_PKG + PERIOD + EVENT_LISTENER + SEMI_COLAN + NEW_LINE; |
267 | } | 267 | } |
268 | 268 | ||
... | @@ -271,7 +271,7 @@ public class JavaImportData { | ... | @@ -271,7 +271,7 @@ public class JavaImportData { |
271 | * | 271 | * |
272 | * @return import string for map class | 272 | * @return import string for map class |
273 | */ | 273 | */ |
274 | - public String getMapImport() { | 274 | + String getMapImport() { |
275 | return IMPORT + COLLECTION_IMPORTS + PERIOD + MAP + SEMI_COLAN + NEW_LINE; | 275 | return IMPORT + COLLECTION_IMPORTS + PERIOD + MAP + SEMI_COLAN + NEW_LINE; |
276 | } | 276 | } |
277 | 277 | ||
... | @@ -280,7 +280,7 @@ public class JavaImportData { | ... | @@ -280,7 +280,7 @@ public class JavaImportData { |
280 | * | 280 | * |
281 | * @return import string for hash map class | 281 | * @return import string for hash map class |
282 | */ | 282 | */ |
283 | - public String getHashMapImport() { | 283 | + String getHashMapImport() { |
284 | return IMPORT + COLLECTION_IMPORTS + PERIOD + HASH_MAP + SEMI_COLAN + NEW_LINE; | 284 | return IMPORT + COLLECTION_IMPORTS + PERIOD + HASH_MAP + SEMI_COLAN + NEW_LINE; |
285 | } | 285 | } |
286 | 286 | ||
... | @@ -289,7 +289,7 @@ public class JavaImportData { | ... | @@ -289,7 +289,7 @@ public class JavaImportData { |
289 | * | 289 | * |
290 | * @return import string for hash map class | 290 | * @return import string for hash map class |
291 | */ | 291 | */ |
292 | - public String getYangAugmentedInfoImport() { | 292 | + String getYangAugmentedInfoImport() { |
293 | return IMPORT + YANG_AUGMENTED_INFO_CLASS_IMPORT_PKG + PERIOD + YANG_AUGMENTED_INFO_CLASS_IMPORT_CLASS; | 293 | return IMPORT + YANG_AUGMENTED_INFO_CLASS_IMPORT_PKG + PERIOD + YANG_AUGMENTED_INFO_CLASS_IMPORT_CLASS; |
294 | } | 294 | } |
295 | 295 | ||
... | @@ -298,7 +298,7 @@ public class JavaImportData { | ... | @@ -298,7 +298,7 @@ public class JavaImportData { |
298 | * | 298 | * |
299 | * @return import string for YangAugmentedOpParamInfo class | 299 | * @return import string for YangAugmentedOpParamInfo class |
300 | */ | 300 | */ |
301 | - public String getYangAugmentedOpParamInfoImport() { | 301 | + String getYangAugmentedOpParamInfoImport() { |
302 | return IMPORT + YANG_AUGMENTED_INFO_CLASS_IMPORT_PKG + PERIOD + | 302 | return IMPORT + YANG_AUGMENTED_INFO_CLASS_IMPORT_PKG + PERIOD + |
303 | YANG_AUGMENTED_OP_PARAM_INFO_CLASS; | 303 | YANG_AUGMENTED_OP_PARAM_INFO_CLASS; |
304 | } | 304 | } | ... | ... |
... | @@ -25,12 +25,12 @@ public interface JavaQualifiedTypeInfoContainer { | ... | @@ -25,12 +25,12 @@ public interface JavaQualifiedTypeInfoContainer { |
25 | * | 25 | * |
26 | * @return java qualified type details | 26 | * @return java qualified type details |
27 | */ | 27 | */ |
28 | - JavaQualifiedTypeInfo getJavaQualifiedInfo(); | 28 | + JavaQualifiedTypeInfoTranslator getJavaQualifiedInfo(); |
29 | 29 | ||
30 | /** | 30 | /** |
31 | * Assign the qualified type info. | 31 | * Assign the qualified type info. |
32 | * | 32 | * |
33 | * @param typeInfo qualified type information | 33 | * @param typeInfo qualified type information |
34 | */ | 34 | */ |
35 | - void setJavaQualifiedInfo(JavaQualifiedTypeInfo typeInfo); | 35 | + void setJavaQualifiedInfo(JavaQualifiedTypeInfoTranslator typeInfo); |
36 | } | 36 | } | ... | ... |
... | @@ -20,10 +20,11 @@ import java.io.Serializable; | ... | @@ -20,10 +20,11 @@ import java.io.Serializable; |
20 | import java.util.Objects; | 20 | import java.util.Objects; |
21 | 21 | ||
22 | import org.onosproject.yangutils.datamodel.YangNode; | 22 | import org.onosproject.yangutils.datamodel.YangNode; |
23 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaQualifiedTypeInfo; | ||
24 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangToJavaNamingConflictUtil; | ||
23 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 25 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
24 | -import org.onosproject.yangutils.translator.tojava.javamodel.JavaLeafInfoContainer; | ||
25 | import org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType; | 26 | import org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType; |
26 | -import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil; | 27 | +import org.onosproject.yangutils.translator.tojava.javamodel.JavaLeafInfoContainer; |
27 | 28 | ||
28 | import com.google.common.base.MoreObjects; | 29 | import com.google.common.base.MoreObjects; |
29 | 30 | ||
... | @@ -33,25 +34,15 @@ import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJa | ... | @@ -33,25 +34,15 @@ import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJa |
33 | /** | 34 | /** |
34 | * Represents the information about individual imports in the generated file. | 35 | * Represents the information about individual imports in the generated file. |
35 | */ | 36 | */ |
36 | -public class JavaQualifiedTypeInfo | 37 | +public class JavaQualifiedTypeInfoTranslator extends JavaQualifiedTypeInfo |
37 | - implements Comparable<JavaQualifiedTypeInfo>, Serializable { | 38 | + implements Comparable<JavaQualifiedTypeInfoTranslator>, Serializable { |
38 | 39 | ||
39 | private static final long serialVersionUID = 806201634L; | 40 | private static final long serialVersionUID = 806201634L; |
40 | 41 | ||
41 | /** | 42 | /** |
42 | - * Package location where the imported class/interface is defined. | ||
43 | - */ | ||
44 | - private String pkgInfo; | ||
45 | - | ||
46 | - /** | ||
47 | - * Class/interface being referenced. | ||
48 | - */ | ||
49 | - private String classInfo; | ||
50 | - | ||
51 | - /** | ||
52 | * Creates a java qualified type info object. | 43 | * Creates a java qualified type info object. |
53 | */ | 44 | */ |
54 | - public JavaQualifiedTypeInfo() { | 45 | + public JavaQualifiedTypeInfoTranslator() { |
55 | } | 46 | } |
56 | 47 | ||
57 | /** | 48 | /** |
... | @@ -97,7 +88,7 @@ public class JavaQualifiedTypeInfo | ... | @@ -97,7 +88,7 @@ public class JavaQualifiedTypeInfo |
97 | */ | 88 | */ |
98 | public static void updateLeavesJavaQualifiedInfo(JavaLeafInfoContainer leaf) { | 89 | public static void updateLeavesJavaQualifiedInfo(JavaLeafInfoContainer leaf) { |
99 | 90 | ||
100 | - JavaQualifiedTypeInfo importInfo = leaf.getJavaQualifiedInfo(); | 91 | + JavaQualifiedTypeInfoTranslator importInfo = leaf.getJavaQualifiedInfo(); |
101 | 92 | ||
102 | if (leaf.getDataType() == null) { | 93 | if (leaf.getDataType() == null) { |
103 | throw new TranslatorException("missing data type of leaf " + leaf.getName()); | 94 | throw new TranslatorException("missing data type of leaf " + leaf.getName()); |
... | @@ -144,10 +135,10 @@ public class JavaQualifiedTypeInfo | ... | @@ -144,10 +135,10 @@ public class JavaQualifiedTypeInfo |
144 | * import info for child class | 135 | * import info for child class |
145 | * @return return the import info for this attribute | 136 | * @return return the import info for this attribute |
146 | */ | 137 | */ |
147 | - public static JavaQualifiedTypeInfo getQualifiedTypeInfoOfCurNode(YangNode curNode, | 138 | + public static JavaQualifiedTypeInfoTranslator getQualifiedTypeInfoOfCurNode(YangNode curNode, |
148 | String attributeName) { | 139 | String attributeName) { |
149 | 140 | ||
150 | - JavaQualifiedTypeInfo importInfo = new JavaQualifiedTypeInfo(); | 141 | + JavaQualifiedTypeInfoTranslator importInfo = new JavaQualifiedTypeInfoTranslator(); |
151 | 142 | ||
152 | if (!(curNode instanceof JavaFileInfoContainer)) { | 143 | if (!(curNode instanceof JavaFileInfoContainer)) { |
153 | throw new TranslatorException("missing java file information to get the package details " | 144 | throw new TranslatorException("missing java file information to get the package details " |
... | @@ -168,14 +159,14 @@ public class JavaQualifiedTypeInfo | ... | @@ -168,14 +159,14 @@ public class JavaQualifiedTypeInfo |
168 | * @param conflictResolver plugin configurations | 159 | * @param conflictResolver plugin configurations |
169 | * @return return the import info for this attribute | 160 | * @return return the import info for this attribute |
170 | */ | 161 | */ |
171 | - public static JavaQualifiedTypeInfo getQualifiedInfoOfFromString(JavaAttributeInfo referredTypesAttrInfo, | 162 | + static JavaQualifiedTypeInfoTranslator getQualifiedInfoOfFromString(JavaAttributeInfo referredTypesAttrInfo, |
172 | YangToJavaNamingConflictUtil conflictResolver) { | 163 | YangToJavaNamingConflictUtil conflictResolver) { |
173 | 164 | ||
174 | /* | 165 | /* |
175 | * Get the java qualified type information for the wrapper classes and | 166 | * Get the java qualified type information for the wrapper classes and |
176 | * set it in new java attribute information. | 167 | * set it in new java attribute information. |
177 | */ | 168 | */ |
178 | - JavaQualifiedTypeInfo qualifiedInfoOfFromString = new JavaQualifiedTypeInfo(); | 169 | + JavaQualifiedTypeInfoTranslator qualifiedInfoOfFromString = new JavaQualifiedTypeInfoTranslator(); |
179 | 170 | ||
180 | qualifiedInfoOfFromString.setClassInfo( | 171 | qualifiedInfoOfFromString.setClassInfo( |
181 | getJavaImportClass(referredTypesAttrInfo.getAttributeType(), true, conflictResolver)); | 172 | getJavaImportClass(referredTypesAttrInfo.getAttributeType(), true, conflictResolver)); |
... | @@ -195,8 +186,8 @@ public class JavaQualifiedTypeInfo | ... | @@ -195,8 +186,8 @@ public class JavaQualifiedTypeInfo |
195 | if (this == obj) { | 186 | if (this == obj) { |
196 | return true; | 187 | return true; |
197 | } | 188 | } |
198 | - if (obj instanceof JavaQualifiedTypeInfo) { | 189 | + if (obj instanceof JavaQualifiedTypeInfoTranslator) { |
199 | - JavaQualifiedTypeInfo other = (JavaQualifiedTypeInfo) obj; | 190 | + JavaQualifiedTypeInfoTranslator other = (JavaQualifiedTypeInfoTranslator) obj; |
200 | return Objects.equals(pkgInfo, other.pkgInfo) && | 191 | return Objects.equals(pkgInfo, other.pkgInfo) && |
201 | Objects.equals(classInfo, other.classInfo); | 192 | Objects.equals(classInfo, other.classInfo); |
202 | } | 193 | } |
... | @@ -209,7 +200,7 @@ public class JavaQualifiedTypeInfo | ... | @@ -209,7 +200,7 @@ public class JavaQualifiedTypeInfo |
209 | * @param importInfo matched import | 200 | * @param importInfo matched import |
210 | * @return if equal or not | 201 | * @return if equal or not |
211 | */ | 202 | */ |
212 | - public boolean exactMatch(JavaQualifiedTypeInfo importInfo) { | 203 | + public boolean exactMatch(JavaQualifiedTypeInfoTranslator importInfo) { |
213 | return equals(importInfo) | 204 | return equals(importInfo) |
214 | && Objects.equals(pkgInfo, importInfo.getPkgInfo()) | 205 | && Objects.equals(pkgInfo, importInfo.getPkgInfo()) |
215 | && Objects.equals(classInfo, importInfo.getClassInfo()); | 206 | && Objects.equals(classInfo, importInfo.getClassInfo()); |
... | @@ -228,7 +219,7 @@ public class JavaQualifiedTypeInfo | ... | @@ -228,7 +219,7 @@ public class JavaQualifiedTypeInfo |
228 | * @param other compared import info. | 219 | * @param other compared import info. |
229 | */ | 220 | */ |
230 | @Override | 221 | @Override |
231 | - public int compareTo(JavaQualifiedTypeInfo other) { | 222 | + public int compareTo(JavaQualifiedTypeInfoTranslator other) { |
232 | return getClassInfo().compareTo(other.getClassInfo()); | 223 | return getClassInfo().compareTo(other.getClassInfo()); |
233 | } | 224 | } |
234 | 225 | ... | ... |
... | @@ -19,7 +19,8 @@ package org.onosproject.yangutils.translator.tojava; | ... | @@ -19,7 +19,8 @@ package org.onosproject.yangutils.translator.tojava; |
19 | import java.io.File; | 19 | import java.io.File; |
20 | import java.io.IOException; | 20 | import java.io.IOException; |
21 | 21 | ||
22 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 22 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
23 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
23 | 24 | ||
24 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.CONSTRUCTOR_IMPL_MASK; | 25 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.CONSTRUCTOR_IMPL_MASK; |
25 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getConstructor; | 26 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getConstructor; | ... | ... |
... | @@ -20,8 +20,9 @@ import java.io.IOException; | ... | @@ -20,8 +20,9 @@ import java.io.IOException; |
20 | 20 | ||
21 | import org.onosproject.yangutils.datamodel.YangNode; | 21 | import org.onosproject.yangutils.datamodel.YangNode; |
22 | import org.onosproject.yangutils.datamodel.YangTypeHolder; | 22 | import org.onosproject.yangutils.datamodel.YangTypeHolder; |
23 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; | ||
24 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
23 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 25 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
24 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
25 | 26 | ||
26 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ALL_EVENT_CLASS_MASK; | 27 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ALL_EVENT_CLASS_MASK; |
27 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ENUM_CLASS; | 28 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ENUM_CLASS; |
... | @@ -106,7 +107,7 @@ public class TempJavaCodeFragmentFiles { | ... | @@ -106,7 +107,7 @@ public class TempJavaCodeFragmentFiles { |
106 | * | 107 | * |
107 | * @param beanTempFiles temp file handle for bean file generation | 108 | * @param beanTempFiles temp file handle for bean file generation |
108 | */ | 109 | */ |
109 | - public void setBeanTempFiles(TempJavaBeanFragmentFiles beanTempFiles) { | 110 | + private void setBeanTempFiles(TempJavaBeanFragmentFiles beanTempFiles) { |
110 | this.beanTempFiles = beanTempFiles; | 111 | this.beanTempFiles = beanTempFiles; |
111 | } | 112 | } |
112 | 113 | ||
... | @@ -124,7 +125,7 @@ public class TempJavaCodeFragmentFiles { | ... | @@ -124,7 +125,7 @@ public class TempJavaCodeFragmentFiles { |
124 | * | 125 | * |
125 | * @param typeTempFiles temp file handle for data type file generation | 126 | * @param typeTempFiles temp file handle for data type file generation |
126 | */ | 127 | */ |
127 | - public void setTypeTempFiles(TempJavaTypeFragmentFiles typeTempFiles) { | 128 | + private void setTypeTempFiles(TempJavaTypeFragmentFiles typeTempFiles) { |
128 | this.typeTempFiles = typeTempFiles; | 129 | this.typeTempFiles = typeTempFiles; |
129 | } | 130 | } |
130 | 131 | ||
... | @@ -142,7 +143,7 @@ public class TempJavaCodeFragmentFiles { | ... | @@ -142,7 +143,7 @@ public class TempJavaCodeFragmentFiles { |
142 | * | 143 | * |
143 | * @param serviceTempFiles temp file handle for service file generation | 144 | * @param serviceTempFiles temp file handle for service file generation |
144 | */ | 145 | */ |
145 | - public void setServiceTempFiles(TempJavaServiceFragmentFiles serviceTempFiles) { | 146 | + private void setServiceTempFiles(TempJavaServiceFragmentFiles serviceTempFiles) { |
146 | this.serviceTempFiles = serviceTempFiles; | 147 | this.serviceTempFiles = serviceTempFiles; |
147 | } | 148 | } |
148 | 149 | ||
... | @@ -160,7 +161,7 @@ public class TempJavaCodeFragmentFiles { | ... | @@ -160,7 +161,7 @@ public class TempJavaCodeFragmentFiles { |
160 | * | 161 | * |
161 | * @param enumerationTempFiles temp file handle for enumeration file generation | 162 | * @param enumerationTempFiles temp file handle for enumeration file generation |
162 | */ | 163 | */ |
163 | - public void setEnumerationTempFiles( | 164 | + private void setEnumerationTempFiles( |
164 | TempJavaEnumerationFragmentFiles enumerationTempFiles) { | 165 | TempJavaEnumerationFragmentFiles enumerationTempFiles) { |
165 | this.enumerationTempFiles = enumerationTempFiles; | 166 | this.enumerationTempFiles = enumerationTempFiles; |
166 | } | 167 | } |
... | @@ -179,7 +180,7 @@ public class TempJavaCodeFragmentFiles { | ... | @@ -179,7 +180,7 @@ public class TempJavaCodeFragmentFiles { |
179 | * | 180 | * |
180 | * @param tempJavaEventFragmentFiles temp file handle for event file generation | 181 | * @param tempJavaEventFragmentFiles temp file handle for event file generation |
181 | */ | 182 | */ |
182 | - public void setEventFragmentFiles(TempJavaEventFragmentFiles tempJavaEventFragmentFiles) { | 183 | + private void setEventFragmentFiles(TempJavaEventFragmentFiles tempJavaEventFragmentFiles) { |
183 | this.tempJavaEventFragmentFiles = tempJavaEventFragmentFiles; | 184 | this.tempJavaEventFragmentFiles = tempJavaEventFragmentFiles; |
184 | } | 185 | } |
185 | 186 | ||
... | @@ -212,7 +213,7 @@ public class TempJavaCodeFragmentFiles { | ... | @@ -212,7 +213,7 @@ public class TempJavaCodeFragmentFiles { |
212 | getServiceTempFiles().generateJavaFile(GENERATE_SERVICE_AND_MANAGER, curNode); | 213 | getServiceTempFiles().generateJavaFile(GENERATE_SERVICE_AND_MANAGER, curNode); |
213 | } | 214 | } |
214 | 215 | ||
215 | - /** | 216 | + /* |
216 | * Creates event, event listener and event subject files. | 217 | * Creates event, event listener and event subject files. |
217 | */ | 218 | */ |
218 | if (fileType == GENERATE_ALL_EVENT_CLASS_MASK) { | 219 | if (fileType == GENERATE_ALL_EVENT_CLASS_MASK) { |
... | @@ -220,7 +221,7 @@ public class TempJavaCodeFragmentFiles { | ... | @@ -220,7 +221,7 @@ public class TempJavaCodeFragmentFiles { |
220 | } | 221 | } |
221 | 222 | ||
222 | /* | 223 | /* |
223 | - * Creats enumeration class file. | 224 | + * Creates enumeration class file. |
224 | */ | 225 | */ |
225 | if (fileType == GENERATE_ENUM_CLASS) { | 226 | if (fileType == GENERATE_ENUM_CLASS) { |
226 | getEnumerationTempFiles().generateJavaFile(GENERATE_ENUM_CLASS, curNode); | 227 | getEnumerationTempFiles().generateJavaFile(GENERATE_ENUM_CLASS, curNode); |
... | @@ -228,32 +229,6 @@ public class TempJavaCodeFragmentFiles { | ... | @@ -228,32 +229,6 @@ public class TempJavaCodeFragmentFiles { |
228 | } | 229 | } |
229 | 230 | ||
230 | /** | 231 | /** |
231 | - * Adds the new attribute info to the target generated temporary files. | ||
232 | - * | ||
233 | - * @param newAttrInfo the attribute info that needs to be added to temporary | ||
234 | - * files | ||
235 | - * @param pluginConfig plugin configurations | ||
236 | - * @throws IOException IO operation fail | ||
237 | - */ | ||
238 | - public void addJavaSnippetInfoToApplicableTempFiles(JavaAttributeInfo newAttrInfo, | ||
239 | - YangPluginConfig pluginConfig) | ||
240 | - throws IOException { | ||
241 | - | ||
242 | - if (getBeanTempFiles() != null) { | ||
243 | - getBeanTempFiles() | ||
244 | - .addJavaSnippetInfoToApplicableTempFiles(newAttrInfo, pluginConfig); | ||
245 | - } | ||
246 | - | ||
247 | - /** | ||
248 | - * Creates user defined data type class file. | ||
249 | - */ | ||
250 | - if (getTypeTempFiles() != null) { | ||
251 | - getTypeTempFiles() | ||
252 | - .addJavaSnippetInfoToApplicableTempFiles(newAttrInfo, pluginConfig); | ||
253 | - } | ||
254 | - } | ||
255 | - | ||
256 | - /** | ||
257 | * Add all the type in the current data model node as part of the | 232 | * Add all the type in the current data model node as part of the |
258 | * generated temporary file. | 233 | * generated temporary file. |
259 | * | 234 | * |
... | @@ -261,7 +236,7 @@ public class TempJavaCodeFragmentFiles { | ... | @@ -261,7 +236,7 @@ public class TempJavaCodeFragmentFiles { |
261 | * @param pluginConfig plugin configurations for naming convention | 236 | * @param pluginConfig plugin configurations for naming convention |
262 | * @throws IOException IO operation fail | 237 | * @throws IOException IO operation fail |
263 | */ | 238 | */ |
264 | - public void addTypeInfoToTempFiles(YangTypeHolder yangTypeHolder, YangPluginConfig pluginConfig) | 239 | + void addTypeInfoToTempFiles(YangTypeHolder yangTypeHolder, YangPluginConfig pluginConfig) |
265 | throws IOException { | 240 | throws IOException { |
266 | getTypeTempFiles() | 241 | getTypeTempFiles() |
267 | .addTypeInfoToTempFiles(yangTypeHolder, pluginConfig); | 242 | .addTypeInfoToTempFiles(yangTypeHolder, pluginConfig); |
... | @@ -327,7 +302,7 @@ public class TempJavaCodeFragmentFiles { | ... | @@ -327,7 +302,7 @@ public class TempJavaCodeFragmentFiles { |
327 | * all open file handles include temporary files and java files. | 302 | * all open file handles include temporary files and java files. |
328 | * @throws IOException when failed to delete the temporary files | 303 | * @throws IOException when failed to delete the temporary files |
329 | */ | 304 | */ |
330 | - public void freeTemporaryResources(boolean isErrorOccurred) | 305 | + void freeTemporaryResources(boolean isErrorOccurred) |
331 | throws IOException { | 306 | throws IOException { |
332 | 307 | ||
333 | if (getBeanTempFiles() != null) { | 308 | if (getBeanTempFiles() != null) { | ... | ... |
... | @@ -22,13 +22,14 @@ import java.util.HashMap; | ... | @@ -22,13 +22,14 @@ import java.util.HashMap; |
22 | import java.util.List; | 22 | import java.util.List; |
23 | import java.util.Map; | 23 | import java.util.Map; |
24 | 24 | ||
25 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; | ||
25 | import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; | 26 | import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
26 | import org.onosproject.yangutils.datamodel.YangEnum; | 27 | import org.onosproject.yangutils.datamodel.YangEnum; |
27 | import org.onosproject.yangutils.datamodel.YangEnumeration; | 28 | import org.onosproject.yangutils.datamodel.YangEnumeration; |
28 | import org.onosproject.yangutils.datamodel.YangNode; | 29 | import org.onosproject.yangutils.datamodel.YangNode; |
29 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 30 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
30 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaType; | 31 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaTypeTranslator; |
31 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 32 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
32 | 33 | ||
33 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.ENUM_IMPL_MASK; | 34 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.ENUM_IMPL_MASK; |
34 | import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; | 35 | import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; |
... | @@ -225,7 +226,7 @@ public class TempJavaEnumerationFragmentFiles extends TempJavaFragmentFiles { | ... | @@ -225,7 +226,7 @@ public class TempJavaEnumerationFragmentFiles extends TempJavaFragmentFiles { |
225 | * @return java attribute | 226 | * @return java attribute |
226 | */ | 227 | */ |
227 | public JavaAttributeInfo getJavaAttributeForEnum(YangPluginConfig pluginConfig) { | 228 | public JavaAttributeInfo getJavaAttributeForEnum(YangPluginConfig pluginConfig) { |
228 | - YangJavaType<?> javaType = new YangJavaType<>(); | 229 | + YangJavaTypeTranslator<?> javaType = new YangJavaTypeTranslator<>(); |
229 | javaType.setDataType(YangDataTypes.INT32); | 230 | javaType.setDataType(YangDataTypes.INT32); |
230 | javaType.setDataTypeName("int"); | 231 | javaType.setDataTypeName("int"); |
231 | javaType.updateJavaQualifiedInfo(pluginConfig.getConflictResolver()); | 232 | javaType.updateJavaQualifiedInfo(pluginConfig.getConflictResolver()); | ... | ... |
... | @@ -22,9 +22,10 @@ import java.util.ArrayList; | ... | @@ -22,9 +22,10 @@ import java.util.ArrayList; |
22 | import java.util.List; | 22 | import java.util.List; |
23 | 23 | ||
24 | import org.onosproject.yangutils.datamodel.YangNode; | 24 | import org.onosproject.yangutils.datamodel.YangNode; |
25 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaGrouping; | 25 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
26 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaGroupingTranslator; | ||
26 | import org.onosproject.yangutils.translator.tojava.utils.JavaExtendsListHolder; | 27 | import org.onosproject.yangutils.translator.tojava.utils.JavaExtendsListHolder; |
27 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 28 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
28 | 29 | ||
29 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_SUBJECT_CLASS; | 30 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_SUBJECT_CLASS; |
30 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.EVENT_ENUM_MASK; | 31 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.EVENT_ENUM_MASK; |
... | @@ -33,7 +34,7 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType. | ... | @@ -33,7 +34,7 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType. |
33 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.EVENT_SUBJECT_GETTER_MASK; | 34 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.EVENT_SUBJECT_GETTER_MASK; |
34 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.EVENT_SUBJECT_SETTER_MASK; | 35 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.EVENT_SUBJECT_SETTER_MASK; |
35 | import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; | 36 | import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; |
36 | -import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfCurNode; | 37 | +import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator.getQualifiedTypeInfoOfCurNode; |
37 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateEventFile; | 38 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateEventFile; |
38 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateEventListenerFile; | 39 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateEventListenerFile; |
39 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateEventSubjectFile; | 40 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateEventSubjectFile; |
... | @@ -319,7 +320,7 @@ public class TempJavaEventFragmentFiles | ... | @@ -319,7 +320,7 @@ public class TempJavaEventFragmentFiles |
319 | 320 | ||
320 | //Creates event interface file. | 321 | //Creates event interface file. |
321 | setEventSubjectJavaFileHandle(getJavaFileHandle(curNode, curNodeInfo + | 322 | setEventSubjectJavaFileHandle(getJavaFileHandle(curNode, curNodeInfo + |
322 | - TempJavaEventFragmentFiles.EVENT_SUBJECT_NAME_SUFFIX)); | 323 | + EVENT_SUBJECT_NAME_SUFFIX)); |
323 | generateEventSubjectFile(getEventSubjectJavaFileHandle(), curNode); | 324 | generateEventSubjectFile(getEventSubjectJavaFileHandle(), curNode); |
324 | 325 | ||
325 | } | 326 | } |
... | @@ -428,7 +429,7 @@ public class TempJavaEventFragmentFiles | ... | @@ -428,7 +429,7 @@ public class TempJavaEventFragmentFiles |
428 | pluginConfig.getConflictResolver())); | 429 | pluginConfig.getConflictResolver())); |
429 | String notificationName = curNode.getName(); | 430 | String notificationName = curNode.getName(); |
430 | 431 | ||
431 | - JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(curNode, | 432 | + JavaQualifiedTypeInfoTranslator qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(curNode, |
432 | getCapitalCase(currentInfo)); | 433 | getCapitalCase(currentInfo)); |
433 | 434 | ||
434 | JavaAttributeInfo javaAttributeInfo = getAttributeInfoForTheData(qualifiedTypeInfo, getSmallCase(currentInfo), | 435 | JavaAttributeInfo javaAttributeInfo = getAttributeInfoForTheData(qualifiedTypeInfo, getSmallCase(currentInfo), |
... | @@ -492,7 +493,7 @@ public class TempJavaEventFragmentFiles | ... | @@ -492,7 +493,7 @@ public class TempJavaEventFragmentFiles |
492 | YangNode childNode = curNode.getChild(); | 493 | YangNode childNode = curNode.getChild(); |
493 | 494 | ||
494 | // Skip grouping, as it wont have the package name. | 495 | // Skip grouping, as it wont have the package name. |
495 | - while (childNode instanceof YangJavaGrouping) { | 496 | + while (childNode instanceof YangJavaGroupingTranslator) { |
496 | childNode = childNode.getNextSibling(); | 497 | childNode = childNode.getNextSibling(); |
497 | } | 498 | } |
498 | JavaFileInfo childInfo = ((JavaFileInfoContainer) childNode).getJavaFileInfo(); | 499 | JavaFileInfo childInfo = ((JavaFileInfoContainer) childNode).getJavaFileInfo(); | ... | ... |
... | @@ -28,13 +28,14 @@ import org.onosproject.yangutils.datamodel.YangLeavesHolder; | ... | @@ -28,13 +28,14 @@ import org.onosproject.yangutils.datamodel.YangLeavesHolder; |
28 | import org.onosproject.yangutils.datamodel.YangModule; | 28 | import org.onosproject.yangutils.datamodel.YangModule; |
29 | import org.onosproject.yangutils.datamodel.YangNode; | 29 | import org.onosproject.yangutils.datamodel.YangNode; |
30 | import org.onosproject.yangutils.datamodel.YangSubModule; | 30 | import org.onosproject.yangutils.datamodel.YangSubModule; |
31 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; | ||
32 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
31 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 33 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
32 | import org.onosproject.yangutils.translator.tojava.javamodel.JavaLeafInfoContainer; | 34 | import org.onosproject.yangutils.translator.tojava.javamodel.JavaLeafInfoContainer; |
33 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaGrouping; | 35 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaGroupingTranslator; |
34 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule; | 36 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModuleTranslator; |
35 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModule; | 37 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModuleTranslator; |
36 | import org.onosproject.yangutils.translator.tojava.utils.JavaExtendsListHolder; | 38 | import org.onosproject.yangutils.translator.tojava.utils.JavaExtendsListHolder; |
37 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
38 | 39 | ||
39 | import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.getParentNodeInGenCode; | 40 | import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.getParentNodeInGenCode; |
40 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK; | 41 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK; |
... | @@ -56,8 +57,8 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType. | ... | @@ -56,8 +57,8 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType. |
56 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_INTERFACE_MASK; | 57 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_INTERFACE_MASK; |
57 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.TO_STRING_IMPL_MASK; | 58 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.TO_STRING_IMPL_MASK; |
58 | import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; | 59 | import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; |
59 | -import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedInfoOfFromString; | 60 | +import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator.getQualifiedInfoOfFromString; |
60 | -import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfCurNode; | 61 | +import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator.getQualifiedTypeInfoOfCurNode; |
61 | import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.updateJavaFileInfo; | 62 | import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.updateJavaFileInfo; |
62 | import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaAttributeDefination; | 63 | import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaAttributeDefination; |
63 | import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaClassDefClose; | 64 | import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaClassDefClose; |
... | @@ -240,7 +241,7 @@ public class TempJavaFragmentFiles { | ... | @@ -240,7 +241,7 @@ public class TempJavaFragmentFiles { |
240 | /** | 241 | /** |
241 | * Java file handle for builder op param class file. | 242 | * Java file handle for builder op param class file. |
242 | */ | 243 | */ |
243 | - private File builderOpParmClassJavaFileHandle; | 244 | + private File builderOpParamClassJavaFileHandle; |
244 | 245 | ||
245 | /** | 246 | /** |
246 | * Java file handle for impl class file. | 247 | * Java file handle for impl class file. |
... | @@ -300,7 +301,7 @@ public class TempJavaFragmentFiles { | ... | @@ -300,7 +301,7 @@ public class TempJavaFragmentFiles { |
300 | /** | 301 | /** |
301 | * Import info for case. | 302 | * Import info for case. |
302 | */ | 303 | */ |
303 | - private JavaQualifiedTypeInfo caseImportInfo; | 304 | + private JavaQualifiedTypeInfoTranslator caseImportInfo; |
304 | 305 | ||
305 | /** | 306 | /** |
306 | * Is attribute added. | 307 | * Is attribute added. |
... | @@ -446,7 +447,7 @@ public class TempJavaFragmentFiles { | ... | @@ -446,7 +447,7 @@ public class TempJavaFragmentFiles { |
446 | throw new TranslatorException("missing parent node to contain current node info in generated file"); | 447 | throw new TranslatorException("missing parent node to contain current node info in generated file"); |
447 | } | 448 | } |
448 | 449 | ||
449 | - if (parent instanceof YangJavaGrouping) { | 450 | + if (parent instanceof YangJavaGroupingTranslator) { |
450 | /* | 451 | /* |
451 | * In case of grouping, there is no need to add the information, it | 452 | * In case of grouping, there is no need to add the information, it |
452 | * will be taken care in uses | 453 | * will be taken care in uses |
... | @@ -484,7 +485,7 @@ public class TempJavaFragmentFiles { | ... | @@ -484,7 +485,7 @@ public class TempJavaFragmentFiles { |
484 | * Get the import info corresponding to the attribute for import in | 485 | * Get the import info corresponding to the attribute for import in |
485 | * generated java files or qualified access | 486 | * generated java files or qualified access |
486 | */ | 487 | */ |
487 | - JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(curNode, | 488 | + JavaQualifiedTypeInfoTranslator qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(curNode, |
488 | getCapitalCase(curNodeName)); | 489 | getCapitalCase(curNodeName)); |
489 | if (!(targetNode instanceof TempJavaCodeFragmentFilesContainer)) { | 490 | if (!(targetNode instanceof TempJavaCodeFragmentFilesContainer)) { |
490 | throw new TranslatorException("Parent node does not have file info"); | 491 | throw new TranslatorException("Parent node does not have file info"); |
... | @@ -493,7 +494,7 @@ public class TempJavaFragmentFiles { | ... | @@ -493,7 +494,7 @@ public class TempJavaFragmentFiles { |
493 | JavaFileInfo fileInfo = ((JavaFileInfoContainer) targetNode).getJavaFileInfo(); | 494 | JavaFileInfo fileInfo = ((JavaFileInfoContainer) targetNode).getJavaFileInfo(); |
494 | 495 | ||
495 | boolean isQualified; | 496 | boolean isQualified; |
496 | - if ((targetNode instanceof YangJavaModule || targetNode instanceof YangJavaSubModule) | 497 | + if ((targetNode instanceof YangJavaModuleTranslator || targetNode instanceof YangJavaSubModuleTranslator) |
497 | && (qualifiedTypeInfo.getClassInfo().contentEquals(SERVICE) | 498 | && (qualifiedTypeInfo.getClassInfo().contentEquals(SERVICE) |
498 | || qualifiedTypeInfo.getClassInfo().contentEquals(COMPONENT) | 499 | || qualifiedTypeInfo.getClassInfo().contentEquals(COMPONENT) |
499 | || qualifiedTypeInfo.getClassInfo().contentEquals(getCapitalCase(ACTIVATE)) | 500 | || qualifiedTypeInfo.getClassInfo().contentEquals(getCapitalCase(ACTIVATE)) |
... | @@ -506,7 +507,7 @@ public class TempJavaFragmentFiles { | ... | @@ -506,7 +507,7 @@ public class TempJavaFragmentFiles { |
506 | isQualified = true; | 507 | isQualified = true; |
507 | } else { | 508 | } else { |
508 | String className; | 509 | String className; |
509 | - if (targetNode instanceof YangJavaModule || targetNode instanceof YangJavaSubModule) { | 510 | + if (targetNode instanceof YangJavaModuleTranslator || targetNode instanceof YangJavaSubModuleTranslator) { |
510 | className = getCapitalCase(fileInfo.getJavaName()) + "Service"; | 511 | className = getCapitalCase(fileInfo.getJavaName()) + "Service"; |
511 | } else { | 512 | } else { |
512 | className = getCapitalCase(fileInfo.getJavaName()); | 513 | className = getCapitalCase(fileInfo.getJavaName()); |
... | @@ -599,17 +600,17 @@ public class TempJavaFragmentFiles { | ... | @@ -599,17 +600,17 @@ public class TempJavaFragmentFiles { |
599 | * | 600 | * |
600 | * @return op param builder temporary file handle | 601 | * @return op param builder temporary file handle |
601 | */ | 602 | */ |
602 | - private File getBuilderOpParmClassJavaFileHandle() { | 603 | + private File getBuilderOpParamClassJavaFileHandle() { |
603 | - return builderOpParmClassJavaFileHandle; | 604 | + return builderOpParamClassJavaFileHandle; |
604 | } | 605 | } |
605 | 606 | ||
606 | /** | 607 | /** |
607 | * Sets the java file handle for op param builder class. | 608 | * Sets the java file handle for op param builder class. |
608 | * | 609 | * |
609 | - * @param builderOpParmClassJavaFileHandle java file handle | 610 | + * @param builderOpParamClassJavaFileHandle java file handle |
610 | */ | 611 | */ |
611 | - private void setBuilderOpParmClassJavaFileHandle(File builderOpParmClassJavaFileHandle) { | 612 | + private void setBuilderOpParamClassJavaFileHandle(File builderOpParamClassJavaFileHandle) { |
612 | - this.builderOpParmClassJavaFileHandle = builderOpParmClassJavaFileHandle; | 613 | + this.builderOpParamClassJavaFileHandle = builderOpParamClassJavaFileHandle; |
613 | } | 614 | } |
614 | 615 | ||
615 | /** | 616 | /** |
... | @@ -1170,11 +1171,17 @@ public class TempJavaFragmentFiles { | ... | @@ -1170,11 +1171,17 @@ public class TempJavaFragmentFiles { |
1170 | String path = getTempDirPath(getAbsoluteDirPath()); | 1171 | String path = getTempDirPath(getAbsoluteDirPath()); |
1171 | File dir = new File(path); | 1172 | File dir = new File(path); |
1172 | if (!dir.exists()) { | 1173 | if (!dir.exists()) { |
1173 | - dir.mkdirs(); | 1174 | + boolean isCreated = dir.mkdirs(); |
1175 | + if (!isCreated) { | ||
1176 | + throw new IOException("failed to create temporary directory for " + fileName); | ||
1177 | + } | ||
1174 | } | 1178 | } |
1175 | File file = new File(path + fileName + TEMP_FILE_EXTENSION); | 1179 | File file = new File(path + fileName + TEMP_FILE_EXTENSION); |
1176 | if (!file.exists()) { | 1180 | if (!file.exists()) { |
1177 | - file.createNewFile(); | 1181 | + boolean isCreated = file.createNewFile(); |
1182 | + if (!isCreated) { | ||
1183 | + throw new IOException("failed to create temporary files for " + fileName); | ||
1184 | + } | ||
1178 | } else { | 1185 | } else { |
1179 | throw new IOException(fileName + " is reused due to YANG naming"); | 1186 | throw new IOException(fileName + " is reused due to YANG naming"); |
1180 | } | 1187 | } |
... | @@ -1273,7 +1280,7 @@ public class TempJavaFragmentFiles { | ... | @@ -1273,7 +1280,7 @@ public class TempJavaFragmentFiles { |
1273 | * @param pluginConfig plugin configurations | 1280 | * @param pluginConfig plugin configurations |
1274 | */ | 1281 | */ |
1275 | void addParentInfoInCurNodeTempFile(YangNode curNode, YangPluginConfig pluginConfig) { | 1282 | void addParentInfoInCurNodeTempFile(YangNode curNode, YangPluginConfig pluginConfig) { |
1276 | - caseImportInfo = new JavaQualifiedTypeInfo(); | 1283 | + caseImportInfo = new JavaQualifiedTypeInfoTranslator(); |
1277 | YangNode parent = getParentNodeInGenCode(curNode); | 1284 | YangNode parent = getParentNodeInGenCode(curNode); |
1278 | if (!(parent instanceof JavaCodeGenerator)) { | 1285 | if (!(parent instanceof JavaCodeGenerator)) { |
1279 | throw new TranslatorException("missing parent node to contain current node info in generated file"); | 1286 | throw new TranslatorException("missing parent node to contain current node info in generated file"); |
... | @@ -1411,7 +1418,7 @@ public class TempJavaFragmentFiles { | ... | @@ -1411,7 +1418,7 @@ public class TempJavaFragmentFiles { |
1411 | } | 1418 | } |
1412 | 1419 | ||
1413 | if ((getGeneratedTempFiles() & FROM_STRING_IMPL_MASK) != 0) { | 1420 | if ((getGeneratedTempFiles() & FROM_STRING_IMPL_MASK) != 0) { |
1414 | - JavaQualifiedTypeInfo qualifiedInfoOfFromString = getQualifiedInfoOfFromString(newAttrInfo, | 1421 | + JavaQualifiedTypeInfoTranslator qualifiedInfoOfFromString = getQualifiedInfoOfFromString(newAttrInfo, |
1415 | pluginConfig.getConflictResolver()); | 1422 | pluginConfig.getConflictResolver()); |
1416 | /* | 1423 | /* |
1417 | * Create a new java attribute info with qualified information of | 1424 | * Create a new java attribute info with qualified information of |
... | @@ -1570,7 +1577,7 @@ public class TempJavaFragmentFiles { | ... | @@ -1570,7 +1577,7 @@ public class TempJavaFragmentFiles { |
1570 | if (curNode instanceof YangAugmentableNode) { | 1577 | if (curNode instanceof YangAugmentableNode) { |
1571 | addYangAugmentedOpParamInfoImport(imports); | 1578 | addYangAugmentedOpParamInfoImport(imports); |
1572 | } | 1579 | } |
1573 | - JavaQualifiedTypeInfo qualifiedTypeInfo = new JavaQualifiedTypeInfo(); | 1580 | + JavaQualifiedTypeInfoTranslator qualifiedTypeInfo = new JavaQualifiedTypeInfoTranslator(); |
1574 | qualifiedTypeInfo.setClassInfo(getCapitalCase(DEFAULT) + getCapitalCase(getJavaFileInfo() | 1581 | qualifiedTypeInfo.setClassInfo(getCapitalCase(DEFAULT) + getCapitalCase(getJavaFileInfo() |
1575 | .getJavaName())); | 1582 | .getJavaName())); |
1576 | qualifiedTypeInfo.setPkgInfo(getJavaFileInfo().getPackage()); | 1583 | qualifiedTypeInfo.setPkgInfo(getJavaFileInfo().getPackage()); |
... | @@ -1592,14 +1599,14 @@ public class TempJavaFragmentFiles { | ... | @@ -1592,14 +1599,14 @@ public class TempJavaFragmentFiles { |
1592 | * Create builder class file. | 1599 | * Create builder class file. |
1593 | */ | 1600 | */ |
1594 | if ((fileType & BUILDER_CLASS_MASK) != 0) { | 1601 | if ((fileType & BUILDER_CLASS_MASK) != 0) { |
1595 | - setBuilderOpParmClassJavaFileHandle(getJavaFileHandle(getOpParamBuilderImplClassName())); | 1602 | + setBuilderOpParamClassJavaFileHandle(getJavaFileHandle(getOpParamBuilderImplClassName())); |
1596 | - setBuilderOpParmClassJavaFileHandle( | 1603 | + setBuilderOpParamClassJavaFileHandle( |
1597 | - generateOpParamBuilderClassFile(getBuilderOpParmClassJavaFileHandle(), curNode, | 1604 | + generateOpParamBuilderClassFile(getBuilderOpParamClassJavaFileHandle(), curNode, |
1598 | isAttributePresent())); | 1605 | isAttributePresent())); |
1599 | /* | 1606 | /* |
1600 | * Append impl class to builder class and close it. | 1607 | * Append impl class to builder class and close it. |
1601 | */ | 1608 | */ |
1602 | - mergeJavaFiles(getBuilderOpParmClassJavaFileHandle(), getOpParamClassJavaFileHandle()); | 1609 | + mergeJavaFiles(getBuilderOpParamClassJavaFileHandle(), getOpParamClassJavaFileHandle()); |
1603 | validateLineLength(getOpParamClassJavaFileHandle()); | 1610 | validateLineLength(getOpParamClassJavaFileHandle()); |
1604 | 1611 | ||
1605 | addBitSetImport(imports, false); | 1612 | addBitSetImport(imports, false); |
... | @@ -1689,7 +1696,7 @@ public class TempJavaFragmentFiles { | ... | @@ -1689,7 +1696,7 @@ public class TempJavaFragmentFiles { |
1689 | */ | 1696 | */ |
1690 | private void removeAugmentedInfoImport(List<String> imports) { | 1697 | private void removeAugmentedInfoImport(List<String> imports) { |
1691 | imports.remove(getJavaImportData().getYangAugmentedInfoImport()); | 1698 | imports.remove(getJavaImportData().getYangAugmentedInfoImport()); |
1692 | - for (JavaQualifiedTypeInfo type : getJavaImportData().getImportSet()) { | 1699 | + for (JavaQualifiedTypeInfoTranslator type : getJavaImportData().getImportSet()) { |
1693 | if (type.getClassInfo().equals(YANG_AUGMENTED_INFO)) { | 1700 | if (type.getClassInfo().equals(YANG_AUGMENTED_INFO)) { |
1694 | getJavaImportData().getImportSet().remove(type); | 1701 | getJavaImportData().getImportSet().remove(type); |
1695 | getJavaExtendsListHolder().getExtendsList().remove(type); | 1702 | getJavaExtendsListHolder().getExtendsList().remove(type); |
... | @@ -1715,7 +1722,7 @@ public class TempJavaFragmentFiles { | ... | @@ -1715,7 +1722,7 @@ public class TempJavaFragmentFiles { |
1715 | closeFile(getBuilderClassJavaFileHandle(), true); | 1722 | closeFile(getBuilderClassJavaFileHandle(), true); |
1716 | } | 1723 | } |
1717 | if ((getGeneratedJavaFiles() & OPERATION_BUILDER_CLASS_MASK) != 0) { | 1724 | if ((getGeneratedJavaFiles() & OPERATION_BUILDER_CLASS_MASK) != 0) { |
1718 | - closeFile(getBuilderOpParmClassJavaFileHandle(), true); | 1725 | + closeFile(getBuilderOpParamClassJavaFileHandle(), true); |
1719 | } | 1726 | } |
1720 | if ((getGeneratedJavaFiles() & BUILDER_INTERFACE_MASK) != 0) { | 1727 | if ((getGeneratedJavaFiles() & BUILDER_INTERFACE_MASK) != 0) { |
1721 | closeFile(getBuilderInterfaceJavaFileHandle(), true); | 1728 | closeFile(getBuilderInterfaceJavaFileHandle(), true); |
... | @@ -1755,7 +1762,7 @@ public class TempJavaFragmentFiles { | ... | @@ -1755,7 +1762,7 @@ public class TempJavaFragmentFiles { |
1755 | * @return status of the qualified access to the attribute | 1762 | * @return status of the qualified access to the attribute |
1756 | */ | 1763 | */ |
1757 | boolean getIsQualifiedAccessOrAddToImportList( | 1764 | boolean getIsQualifiedAccessOrAddToImportList( |
1758 | - JavaQualifiedTypeInfo importInfo) { | 1765 | + JavaQualifiedTypeInfoTranslator importInfo) { |
1759 | 1766 | ||
1760 | return getJavaImportData().addImportInfo(importInfo, getGeneratedJavaClassName(), | 1767 | return getJavaImportData().addImportInfo(importInfo, getGeneratedJavaClassName(), |
1761 | getJavaFileInfo().getPackage()); | 1768 | getJavaFileInfo().getPackage()); | ... | ... |
... | @@ -21,10 +21,11 @@ import java.io.IOException; | ... | @@ -21,10 +21,11 @@ import java.io.IOException; |
21 | import java.util.List; | 21 | import java.util.List; |
22 | 22 | ||
23 | import org.onosproject.yangutils.datamodel.YangNode; | 23 | import org.onosproject.yangutils.datamodel.YangNode; |
24 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule; | 24 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
25 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModule; | 25 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModuleTranslator; |
26 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModuleTranslator; | ||
26 | import org.onosproject.yangutils.translator.tojava.utils.JavaExtendsListHolder; | 27 | import org.onosproject.yangutils.translator.tojava.utils.JavaExtendsListHolder; |
27 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 28 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
28 | 29 | ||
29 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.RPC_IMPL_MASK; | 30 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.RPC_IMPL_MASK; |
30 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.RPC_INTERFACE_MASK; | 31 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.RPC_INTERFACE_MASK; |
... | @@ -213,12 +214,12 @@ public class TempJavaServiceFragmentFiles | ... | @@ -213,12 +214,12 @@ public class TempJavaServiceFragmentFiles |
213 | .getJavaImportData().getImports(); | 214 | .getJavaImportData().getImports(); |
214 | createPackage(curNode); | 215 | createPackage(curNode); |
215 | boolean isNotification = false; | 216 | boolean isNotification = false; |
216 | - if (curNode instanceof YangJavaModule) { | 217 | + if (curNode instanceof YangJavaModuleTranslator) { |
217 | - if (!((YangJavaModule) curNode).getNotificationNodes().isEmpty()) { | 218 | + if (!((YangJavaModuleTranslator) curNode).getNotificationNodes().isEmpty()) { |
218 | isNotification = true; | 219 | isNotification = true; |
219 | } | 220 | } |
220 | - } else if (curNode instanceof YangJavaSubModule) { | 221 | + } else if (curNode instanceof YangJavaSubModuleTranslator) { |
221 | - if (!((YangJavaSubModule) curNode).getNotificationNodes().isEmpty()) { | 222 | + if (!((YangJavaSubModuleTranslator) curNode).getNotificationNodes().isEmpty()) { |
222 | isNotification = true; | 223 | isNotification = true; |
223 | } | 224 | } |
224 | } | 225 | } | ... | ... |
... | @@ -24,10 +24,11 @@ import java.util.List; | ... | @@ -24,10 +24,11 @@ import java.util.List; |
24 | import org.onosproject.yangutils.datamodel.YangNode; | 24 | import org.onosproject.yangutils.datamodel.YangNode; |
25 | import org.onosproject.yangutils.datamodel.YangType; | 25 | import org.onosproject.yangutils.datamodel.YangType; |
26 | import org.onosproject.yangutils.datamodel.YangTypeHolder; | 26 | import org.onosproject.yangutils.datamodel.YangTypeHolder; |
27 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; | ||
28 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
27 | import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; | 29 | import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
28 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 30 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
29 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaType; | 31 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaTypeTranslator; |
30 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
31 | 32 | ||
32 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT32; | 33 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT32; |
33 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT64; | 34 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT64; |
... | @@ -39,7 +40,7 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType. | ... | @@ -39,7 +40,7 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType. |
39 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.FROM_STRING_IMPL_MASK; | 40 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.FROM_STRING_IMPL_MASK; |
40 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.OF_STRING_IMPL_MASK; | 41 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.OF_STRING_IMPL_MASK; |
41 | import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; | 42 | import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; |
42 | -import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedInfoOfFromString; | 43 | +import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator.getQualifiedInfoOfFromString; |
43 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateTypeDefClassFile; | 44 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateTypeDefClassFile; |
44 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateUnionClassFile; | 45 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateUnionClassFile; |
45 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.createPackage; | 46 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.createPackage; |
... | @@ -250,7 +251,7 @@ public class TempJavaTypeFragmentFiles | ... | @@ -250,7 +251,7 @@ public class TempJavaTypeFragmentFiles |
250 | List<YangType<?>> typeList = yangTypeHolder.getTypeList(); | 251 | List<YangType<?>> typeList = yangTypeHolder.getTypeList(); |
251 | if (typeList != null) { | 252 | if (typeList != null) { |
252 | for (YangType<?> yangType : typeList) { | 253 | for (YangType<?> yangType : typeList) { |
253 | - if (!(yangType instanceof YangJavaType)) { | 254 | + if (!(yangType instanceof YangJavaTypeTranslator)) { |
254 | throw new TranslatorException("Type does not have Java info"); | 255 | throw new TranslatorException("Type does not have Java info"); |
255 | } | 256 | } |
256 | JavaAttributeInfo javaAttributeInfo = getAttributeForType(yangType, pluginConfig); | 257 | JavaAttributeInfo javaAttributeInfo = getAttributeForType(yangType, pluginConfig); |
... | @@ -270,7 +271,7 @@ public class TempJavaTypeFragmentFiles | ... | @@ -270,7 +271,7 @@ public class TempJavaTypeFragmentFiles |
270 | * @return java attribute | 271 | * @return java attribute |
271 | */ | 272 | */ |
272 | private JavaAttributeInfo getAttributeForType(YangType yangType, YangPluginConfig pluginConfig) { | 273 | private JavaAttributeInfo getAttributeForType(YangType yangType, YangPluginConfig pluginConfig) { |
273 | - YangJavaType<?> javaType = (YangJavaType<?>) yangType; | 274 | + YangJavaTypeTranslator<?> javaType = (YangJavaTypeTranslator<?>) yangType; |
274 | javaType.updateJavaQualifiedInfo(pluginConfig.getConflictResolver()); | 275 | javaType.updateJavaQualifiedInfo(pluginConfig.getConflictResolver()); |
275 | String typeName = javaType.getDataTypeName(); | 276 | String typeName = javaType.getDataTypeName(); |
276 | typeName = getCamelCase(typeName, pluginConfig.getConflictResolver()); | 277 | typeName = getCamelCase(typeName, pluginConfig.getConflictResolver()); |
... | @@ -317,11 +318,11 @@ public class TempJavaTypeFragmentFiles | ... | @@ -317,11 +318,11 @@ public class TempJavaTypeFragmentFiles |
317 | } | 318 | } |
318 | 319 | ||
319 | /** | 320 | /** |
320 | - * Adds of method and constructor when there is no conflictiing types. | 321 | + * Adds of method and constructor when there is no conflicting types. |
321 | * | 322 | * |
322 | * @param javaAttributeInfo java attribute info | 323 | * @param javaAttributeInfo java attribute info |
323 | * @param pluginConfig plugin configurations | 324 | * @param pluginConfig plugin configurations |
324 | - * @throws IOException when fails to do IO opearions | 325 | + * @throws IOException when fails to do IO operations |
325 | */ | 326 | */ |
326 | private void addMethodsWhenNoConflictingTypes(JavaAttributeInfo javaAttributeInfo, | 327 | private void addMethodsWhenNoConflictingTypes(JavaAttributeInfo javaAttributeInfo, |
327 | YangPluginConfig pluginConfig) throws IOException { | 328 | YangPluginConfig pluginConfig) throws IOException { |
... | @@ -394,7 +395,7 @@ public class TempJavaTypeFragmentFiles | ... | @@ -394,7 +395,7 @@ public class TempJavaTypeFragmentFiles |
394 | */ | 395 | */ |
395 | private void addFromStringMethod(JavaAttributeInfo newAttrInfo, YangPluginConfig pluginConfig) throws IOException { | 396 | private void addFromStringMethod(JavaAttributeInfo newAttrInfo, YangPluginConfig pluginConfig) throws IOException { |
396 | 397 | ||
397 | - JavaQualifiedTypeInfo qualifiedInfoOfFromString = getQualifiedInfoOfFromString(newAttrInfo, | 398 | + JavaQualifiedTypeInfoTranslator qualifiedInfoOfFromString = getQualifiedInfoOfFromString(newAttrInfo, |
398 | pluginConfig.getConflictResolver()); | 399 | pluginConfig.getConflictResolver()); |
399 | /* | 400 | /* |
400 | * Create a new java attribute info with qualified information of | 401 | * Create a new java attribute info with qualified information of | ... | ... |
... | @@ -36,26 +36,26 @@ import org.onosproject.yangutils.datamodel.YangUnion; | ... | @@ -36,26 +36,26 @@ import org.onosproject.yangutils.datamodel.YangUnion; |
36 | import org.onosproject.yangutils.datamodel.YangUses; | 36 | import org.onosproject.yangutils.datamodel.YangUses; |
37 | import org.onosproject.yangutils.datamodel.utils.GeneratedLanguage; | 37 | import org.onosproject.yangutils.datamodel.utils.GeneratedLanguage; |
38 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 38 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
39 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaAugment; | 39 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaAugmentTranslator; |
40 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaCase; | 40 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaCaseTranslator; |
41 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaChoice; | 41 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaChoiceTranslator; |
42 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaContainer; | 42 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaContainerTranslator; |
43 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaEnumeration; | 43 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaEnumerationTranslator; |
44 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaGrouping; | 44 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaGroupingTranslator; |
45 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaIdentity; | 45 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaIdentityTranslator; |
46 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaInput; | 46 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaInputTranslator; |
47 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaLeaf; | 47 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaLeafTranslator; |
48 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaLeafList; | 48 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaLeafListTranslator; |
49 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaList; | 49 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaListTranslator; |
50 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule; | 50 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModuleTranslator; |
51 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaNotification; | 51 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaNotificationTranslator; |
52 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaOutput; | 52 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaOutputTranslator; |
53 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaRpc; | 53 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaRpcTranslator; |
54 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModule; | 54 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModuleTranslator; |
55 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaType; | 55 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaTypeTranslator; |
56 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaTypeDef; | 56 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaTypeDefTranslator; |
57 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaUnion; | 57 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaUnionTranslator; |
58 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaUses; | 58 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaUsesTranslator; |
59 | 59 | ||
60 | /** | 60 | /** |
61 | * Represents factory to create data model objects based on the target file type. | 61 | * Represents factory to create data model objects based on the target file type. |
... | @@ -78,7 +78,7 @@ public final class YangDataModelFactory { | ... | @@ -78,7 +78,7 @@ public final class YangDataModelFactory { |
78 | public static YangModule getYangModuleNode(GeneratedLanguage targetLanguage) { | 78 | public static YangModule getYangModuleNode(GeneratedLanguage targetLanguage) { |
79 | switch (targetLanguage) { | 79 | switch (targetLanguage) { |
80 | case JAVA_GENERATION: { | 80 | case JAVA_GENERATION: { |
81 | - return new YangJavaModule(); | 81 | + return new YangJavaModuleTranslator(); |
82 | } | 82 | } |
83 | default: { | 83 | default: { |
84 | throw new TranslatorException("Only YANG to Java is supported."); | 84 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -96,7 +96,7 @@ public final class YangDataModelFactory { | ... | @@ -96,7 +96,7 @@ public final class YangDataModelFactory { |
96 | public static YangAugment getYangAugmentNode(GeneratedLanguage targetLanguage) { | 96 | public static YangAugment getYangAugmentNode(GeneratedLanguage targetLanguage) { |
97 | switch (targetLanguage) { | 97 | switch (targetLanguage) { |
98 | case JAVA_GENERATION: { | 98 | case JAVA_GENERATION: { |
99 | - return new YangJavaAugment(); | 99 | + return new YangJavaAugmentTranslator(); |
100 | } | 100 | } |
101 | default: { | 101 | default: { |
102 | throw new TranslatorException("Only YANG to Java is supported."); | 102 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -114,7 +114,7 @@ public final class YangDataModelFactory { | ... | @@ -114,7 +114,7 @@ public final class YangDataModelFactory { |
114 | public static YangCase getYangCaseNode(GeneratedLanguage targetLanguage) { | 114 | public static YangCase getYangCaseNode(GeneratedLanguage targetLanguage) { |
115 | switch (targetLanguage) { | 115 | switch (targetLanguage) { |
116 | case JAVA_GENERATION: { | 116 | case JAVA_GENERATION: { |
117 | - return new YangJavaCase(); | 117 | + return new YangJavaCaseTranslator(); |
118 | } | 118 | } |
119 | default: { | 119 | default: { |
120 | throw new TranslatorException("Only YANG to Java is supported."); | 120 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -132,7 +132,7 @@ public final class YangDataModelFactory { | ... | @@ -132,7 +132,7 @@ public final class YangDataModelFactory { |
132 | public static YangChoice getYangChoiceNode(GeneratedLanguage targetLanguage) { | 132 | public static YangChoice getYangChoiceNode(GeneratedLanguage targetLanguage) { |
133 | switch (targetLanguage) { | 133 | switch (targetLanguage) { |
134 | case JAVA_GENERATION: { | 134 | case JAVA_GENERATION: { |
135 | - return new YangJavaChoice(); | 135 | + return new YangJavaChoiceTranslator(); |
136 | } | 136 | } |
137 | default: { | 137 | default: { |
138 | throw new TranslatorException("Only YANG to Java is supported."); | 138 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -150,7 +150,7 @@ public final class YangDataModelFactory { | ... | @@ -150,7 +150,7 @@ public final class YangDataModelFactory { |
150 | public static YangContainer getYangContainerNode(GeneratedLanguage targetLanguage) { | 150 | public static YangContainer getYangContainerNode(GeneratedLanguage targetLanguage) { |
151 | switch (targetLanguage) { | 151 | switch (targetLanguage) { |
152 | case JAVA_GENERATION: { | 152 | case JAVA_GENERATION: { |
153 | - return new YangJavaContainer(); | 153 | + return new YangJavaContainerTranslator(); |
154 | } | 154 | } |
155 | default: { | 155 | default: { |
156 | throw new TranslatorException("Only YANG to Java is supported."); | 156 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -168,7 +168,7 @@ public final class YangDataModelFactory { | ... | @@ -168,7 +168,7 @@ public final class YangDataModelFactory { |
168 | public static YangIdentity getYangIdentityNode(GeneratedLanguage targetLanguage) { | 168 | public static YangIdentity getYangIdentityNode(GeneratedLanguage targetLanguage) { |
169 | switch (targetLanguage) { | 169 | switch (targetLanguage) { |
170 | case JAVA_GENERATION: { | 170 | case JAVA_GENERATION: { |
171 | - return new YangJavaIdentity(); | 171 | + return new YangJavaIdentityTranslator(); |
172 | } | 172 | } |
173 | default: { | 173 | default: { |
174 | throw new TranslatorException("Only YANG to Java is supported."); | 174 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -186,7 +186,7 @@ public final class YangDataModelFactory { | ... | @@ -186,7 +186,7 @@ public final class YangDataModelFactory { |
186 | public static YangGrouping getYangGroupingNode(GeneratedLanguage targetLanguage) { | 186 | public static YangGrouping getYangGroupingNode(GeneratedLanguage targetLanguage) { |
187 | switch (targetLanguage) { | 187 | switch (targetLanguage) { |
188 | case JAVA_GENERATION: { | 188 | case JAVA_GENERATION: { |
189 | - return new YangJavaGrouping(); | 189 | + return new YangJavaGroupingTranslator(); |
190 | } | 190 | } |
191 | default: { | 191 | default: { |
192 | throw new TranslatorException("Only YANG to Java is supported."); | 192 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -204,7 +204,7 @@ public final class YangDataModelFactory { | ... | @@ -204,7 +204,7 @@ public final class YangDataModelFactory { |
204 | public static YangList getYangListNode(GeneratedLanguage targetLanguage) { | 204 | public static YangList getYangListNode(GeneratedLanguage targetLanguage) { |
205 | switch (targetLanguage) { | 205 | switch (targetLanguage) { |
206 | case JAVA_GENERATION: { | 206 | case JAVA_GENERATION: { |
207 | - return new YangJavaList(); | 207 | + return new YangJavaListTranslator(); |
208 | } | 208 | } |
209 | default: { | 209 | default: { |
210 | throw new TranslatorException("Only YANG to Java is supported."); | 210 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -222,7 +222,7 @@ public final class YangDataModelFactory { | ... | @@ -222,7 +222,7 @@ public final class YangDataModelFactory { |
222 | public static YangSubModule getYangSubModuleNode(GeneratedLanguage targetLanguage) { | 222 | public static YangSubModule getYangSubModuleNode(GeneratedLanguage targetLanguage) { |
223 | switch (targetLanguage) { | 223 | switch (targetLanguage) { |
224 | case JAVA_GENERATION: { | 224 | case JAVA_GENERATION: { |
225 | - return new YangJavaSubModule(); | 225 | + return new YangJavaSubModuleTranslator(); |
226 | } | 226 | } |
227 | default: { | 227 | default: { |
228 | throw new TranslatorException("Only YANG to Java is supported."); | 228 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -240,7 +240,7 @@ public final class YangDataModelFactory { | ... | @@ -240,7 +240,7 @@ public final class YangDataModelFactory { |
240 | public static YangTypeDef getYangTypeDefNode(GeneratedLanguage targetLanguage) { | 240 | public static YangTypeDef getYangTypeDefNode(GeneratedLanguage targetLanguage) { |
241 | switch (targetLanguage) { | 241 | switch (targetLanguage) { |
242 | case JAVA_GENERATION: { | 242 | case JAVA_GENERATION: { |
243 | - return new YangJavaTypeDef(); | 243 | + return new YangJavaTypeDefTranslator(); |
244 | } | 244 | } |
245 | default: { | 245 | default: { |
246 | throw new TranslatorException("Only YANG to Java is supported."); | 246 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -258,7 +258,7 @@ public final class YangDataModelFactory { | ... | @@ -258,7 +258,7 @@ public final class YangDataModelFactory { |
258 | public static YangUnion getYangUnionNode(GeneratedLanguage targetLanguage) { | 258 | public static YangUnion getYangUnionNode(GeneratedLanguage targetLanguage) { |
259 | switch (targetLanguage) { | 259 | switch (targetLanguage) { |
260 | case JAVA_GENERATION: { | 260 | case JAVA_GENERATION: { |
261 | - return new YangJavaUnion(); | 261 | + return new YangJavaUnionTranslator(); |
262 | } | 262 | } |
263 | default: { | 263 | default: { |
264 | throw new TranslatorException("Only YANG to Java is supported."); | 264 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -276,7 +276,7 @@ public final class YangDataModelFactory { | ... | @@ -276,7 +276,7 @@ public final class YangDataModelFactory { |
276 | public static YangUses getYangUsesNode(GeneratedLanguage targetLanguage) { | 276 | public static YangUses getYangUsesNode(GeneratedLanguage targetLanguage) { |
277 | switch (targetLanguage) { | 277 | switch (targetLanguage) { |
278 | case JAVA_GENERATION: { | 278 | case JAVA_GENERATION: { |
279 | - return new YangJavaUses(); | 279 | + return new YangJavaUsesTranslator(); |
280 | } | 280 | } |
281 | default: { | 281 | default: { |
282 | throw new TranslatorException("Only YANG to Java is supported."); | 282 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -294,7 +294,7 @@ public final class YangDataModelFactory { | ... | @@ -294,7 +294,7 @@ public final class YangDataModelFactory { |
294 | public static YangNotification getYangNotificationNode(GeneratedLanguage targetLanguage) { | 294 | public static YangNotification getYangNotificationNode(GeneratedLanguage targetLanguage) { |
295 | switch (targetLanguage) { | 295 | switch (targetLanguage) { |
296 | case JAVA_GENERATION: { | 296 | case JAVA_GENERATION: { |
297 | - return new YangJavaNotification(); | 297 | + return new YangJavaNotificationTranslator(); |
298 | } | 298 | } |
299 | default: { | 299 | default: { |
300 | throw new TranslatorException("Only YANG to Java is supported."); | 300 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -312,7 +312,7 @@ public final class YangDataModelFactory { | ... | @@ -312,7 +312,7 @@ public final class YangDataModelFactory { |
312 | public static YangLeaf getYangLeaf(GeneratedLanguage targetLanguage) { | 312 | public static YangLeaf getYangLeaf(GeneratedLanguage targetLanguage) { |
313 | switch (targetLanguage) { | 313 | switch (targetLanguage) { |
314 | case JAVA_GENERATION: { | 314 | case JAVA_GENERATION: { |
315 | - return new YangJavaLeaf(); | 315 | + return new YangJavaLeafTranslator(); |
316 | } | 316 | } |
317 | default: { | 317 | default: { |
318 | throw new RuntimeException("Only YANG to Java is supported."); | 318 | throw new RuntimeException("Only YANG to Java is supported."); |
... | @@ -330,7 +330,7 @@ public final class YangDataModelFactory { | ... | @@ -330,7 +330,7 @@ public final class YangDataModelFactory { |
330 | public static YangLeafList getYangLeafList(GeneratedLanguage targetLanguage) { | 330 | public static YangLeafList getYangLeafList(GeneratedLanguage targetLanguage) { |
331 | switch (targetLanguage) { | 331 | switch (targetLanguage) { |
332 | case JAVA_GENERATION: { | 332 | case JAVA_GENERATION: { |
333 | - return new YangJavaLeafList(); | 333 | + return new YangJavaLeafListTranslator(); |
334 | } | 334 | } |
335 | default: { | 335 | default: { |
336 | throw new RuntimeException("Only YANG to Java is supported."); | 336 | throw new RuntimeException("Only YANG to Java is supported."); |
... | @@ -348,7 +348,7 @@ public final class YangDataModelFactory { | ... | @@ -348,7 +348,7 @@ public final class YangDataModelFactory { |
348 | public static YangRpc getYangRpcNode(GeneratedLanguage targetLanguage) { | 348 | public static YangRpc getYangRpcNode(GeneratedLanguage targetLanguage) { |
349 | switch (targetLanguage) { | 349 | switch (targetLanguage) { |
350 | case JAVA_GENERATION: { | 350 | case JAVA_GENERATION: { |
351 | - return new YangJavaRpc(); | 351 | + return new YangJavaRpcTranslator(); |
352 | } | 352 | } |
353 | default: { | 353 | default: { |
354 | throw new TranslatorException("Only YANG to Java is supported."); | 354 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -366,7 +366,7 @@ public final class YangDataModelFactory { | ... | @@ -366,7 +366,7 @@ public final class YangDataModelFactory { |
366 | public static YangInput getYangInputNode(GeneratedLanguage targetLanguage) { | 366 | public static YangInput getYangInputNode(GeneratedLanguage targetLanguage) { |
367 | switch (targetLanguage) { | 367 | switch (targetLanguage) { |
368 | case JAVA_GENERATION: { | 368 | case JAVA_GENERATION: { |
369 | - return new YangJavaInput(); | 369 | + return new YangJavaInputTranslator(); |
370 | } | 370 | } |
371 | default: { | 371 | default: { |
372 | throw new TranslatorException("Only YANG to Java is supported."); | 372 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -384,7 +384,7 @@ public final class YangDataModelFactory { | ... | @@ -384,7 +384,7 @@ public final class YangDataModelFactory { |
384 | public static YangOutput getYangOutputNode(GeneratedLanguage targetLanguage) { | 384 | public static YangOutput getYangOutputNode(GeneratedLanguage targetLanguage) { |
385 | switch (targetLanguage) { | 385 | switch (targetLanguage) { |
386 | case JAVA_GENERATION: { | 386 | case JAVA_GENERATION: { |
387 | - return new YangJavaOutput(); | 387 | + return new YangJavaOutputTranslator(); |
388 | } | 388 | } |
389 | default: { | 389 | default: { |
390 | throw new TranslatorException("Only YANG to Java is supported."); | 390 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -399,10 +399,10 @@ public final class YangDataModelFactory { | ... | @@ -399,10 +399,10 @@ public final class YangDataModelFactory { |
399 | * generated | 399 | * generated |
400 | * @return the corresponding inherited node based on the target language | 400 | * @return the corresponding inherited node based on the target language |
401 | */ | 401 | */ |
402 | - public static YangJavaEnumeration getYangEnumerationNode(GeneratedLanguage targetLanguage) { | 402 | + public static YangJavaEnumerationTranslator getYangEnumerationNode(GeneratedLanguage targetLanguage) { |
403 | switch (targetLanguage) { | 403 | switch (targetLanguage) { |
404 | case JAVA_GENERATION: { | 404 | case JAVA_GENERATION: { |
405 | - return new YangJavaEnumeration(); | 405 | + return new YangJavaEnumerationTranslator(); |
406 | } | 406 | } |
407 | default: { | 407 | default: { |
408 | throw new TranslatorException("Only YANG to Java is supported."); | 408 | throw new TranslatorException("Only YANG to Java is supported."); |
... | @@ -419,7 +419,7 @@ public final class YangDataModelFactory { | ... | @@ -419,7 +419,7 @@ public final class YangDataModelFactory { |
419 | public static YangType getYangType(GeneratedLanguage targetLanguage) { | 419 | public static YangType getYangType(GeneratedLanguage targetLanguage) { |
420 | switch (targetLanguage) { | 420 | switch (targetLanguage) { |
421 | case JAVA_GENERATION: { | 421 | case JAVA_GENERATION: { |
422 | - return new YangJavaType(); | 422 | + return new YangJavaTypeTranslator(); |
423 | } | 423 | } |
424 | default: { | 424 | default: { |
425 | throw new RuntimeException("Only YANG to Java is supported."); | 425 | throw new RuntimeException("Only YANG to Java is supported."); | ... | ... |
... | @@ -26,19 +26,18 @@ import org.onosproject.yangutils.datamodel.YangAugment; | ... | @@ -26,19 +26,18 @@ import org.onosproject.yangutils.datamodel.YangAugment; |
26 | import org.onosproject.yangutils.datamodel.YangCase; | 26 | import org.onosproject.yangutils.datamodel.YangCase; |
27 | import org.onosproject.yangutils.datamodel.YangChoice; | 27 | import org.onosproject.yangutils.datamodel.YangChoice; |
28 | import org.onosproject.yangutils.datamodel.YangLeavesHolder; | 28 | import org.onosproject.yangutils.datamodel.YangLeavesHolder; |
29 | -import org.onosproject.yangutils.datamodel.YangModule; | ||
30 | import org.onosproject.yangutils.datamodel.YangNode; | 29 | import org.onosproject.yangutils.datamodel.YangNode; |
31 | import org.onosproject.yangutils.datamodel.YangNodeIdentifier; | 30 | import org.onosproject.yangutils.datamodel.YangNodeIdentifier; |
32 | -import org.onosproject.yangutils.datamodel.YangSubModule; | ||
33 | import org.onosproject.yangutils.datamodel.YangTranslatorOperatorNode; | 31 | import org.onosproject.yangutils.datamodel.YangTranslatorOperatorNode; |
34 | import org.onosproject.yangutils.datamodel.YangTypeHolder; | 32 | import org.onosproject.yangutils.datamodel.YangTypeHolder; |
33 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; | ||
34 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
35 | import org.onosproject.yangutils.datamodel.utils.DataModelUtils; | 35 | import org.onosproject.yangutils.datamodel.utils.DataModelUtils; |
36 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 36 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
37 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaAugment; | 37 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaAugmentTranslator; |
38 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaEnumeration; | 38 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaEnumerationTranslator; |
39 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule; | 39 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModuleTranslator; |
40 | -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModule; | 40 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModuleTranslator; |
41 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
42 | 41 | ||
43 | import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.isRpcChildNodePresent; | 42 | import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.isRpcChildNodePresent; |
44 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER; | 43 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER; |
... | @@ -74,9 +73,9 @@ public final class YangJavaModelUtils { | ... | @@ -74,9 +73,9 @@ public final class YangJavaModelUtils { |
74 | public static void updatePackageInfo(JavaCodeGeneratorInfo javaCodeGeneratorInfo, | 73 | public static void updatePackageInfo(JavaCodeGeneratorInfo javaCodeGeneratorInfo, |
75 | YangPluginConfig yangPluginConfig) | 74 | YangPluginConfig yangPluginConfig) |
76 | throws IOException { | 75 | throws IOException { |
77 | - if (javaCodeGeneratorInfo instanceof YangJavaAugment) { | 76 | + if (javaCodeGeneratorInfo instanceof YangJavaAugmentTranslator) { |
78 | javaCodeGeneratorInfo.getJavaFileInfo() | 77 | javaCodeGeneratorInfo.getJavaFileInfo() |
79 | - .setJavaName(getAugmentClassName((YangJavaAugment) javaCodeGeneratorInfo, | 78 | + .setJavaName(getAugmentClassName((YangJavaAugmentTranslator) javaCodeGeneratorInfo, |
80 | yangPluginConfig)); | 79 | yangPluginConfig)); |
81 | } else { | 80 | } else { |
82 | javaCodeGeneratorInfo.getJavaFileInfo() | 81 | javaCodeGeneratorInfo.getJavaFileInfo() |
... | @@ -137,13 +136,13 @@ public final class YangJavaModelUtils { | ... | @@ -137,13 +136,13 @@ public final class YangJavaModelUtils { |
137 | javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles() | 136 | javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles() |
138 | .getServiceTempFiles().addCurNodeLeavesInfoToTempFiles( | 137 | .getServiceTempFiles().addCurNodeLeavesInfoToTempFiles( |
139 | (YangNode) javaCodeGeneratorInfo, yangPluginConfig); | 138 | (YangNode) javaCodeGeneratorInfo, yangPluginConfig); |
140 | - if (javaCodeGeneratorInfo instanceof YangJavaModule) { | 139 | + if (javaCodeGeneratorInfo instanceof YangJavaModuleTranslator) { |
141 | - if (!((YangJavaModule) javaCodeGeneratorInfo).getNotificationNodes().isEmpty()) { | 140 | + if (!((YangJavaModuleTranslator) javaCodeGeneratorInfo).getNotificationNodes().isEmpty()) { |
142 | - updateNotificaitonNodeInfo(javaCodeGeneratorInfo, yangPluginConfig); | 141 | + updateNotificationNodeInfo(javaCodeGeneratorInfo, yangPluginConfig); |
143 | } | 142 | } |
144 | - } else if (javaCodeGeneratorInfo instanceof YangJavaSubModule) { | 143 | + } else if (javaCodeGeneratorInfo instanceof YangJavaSubModuleTranslator) { |
145 | - if (!((YangJavaSubModule) javaCodeGeneratorInfo).getNotificationNodes().isEmpty()) { | 144 | + if (!((YangJavaSubModuleTranslator) javaCodeGeneratorInfo).getNotificationNodes().isEmpty()) { |
146 | - updateNotificaitonNodeInfo(javaCodeGeneratorInfo, yangPluginConfig); | 145 | + updateNotificationNodeInfo(javaCodeGeneratorInfo, yangPluginConfig); |
147 | } | 146 | } |
148 | } | 147 | } |
149 | 148 | ||
... | @@ -168,7 +167,7 @@ public final class YangJavaModelUtils { | ... | @@ -168,7 +167,7 @@ public final class YangJavaModelUtils { |
168 | */ | 167 | */ |
169 | javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles() | 168 | javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles() |
170 | .addTypeInfoToTempFiles((YangTypeHolder) javaCodeGeneratorInfo, yangPluginConfig); | 169 | .addTypeInfoToTempFiles((YangTypeHolder) javaCodeGeneratorInfo, yangPluginConfig); |
171 | - } else if (javaCodeGeneratorInfo instanceof YangJavaEnumeration) { | 170 | + } else if (javaCodeGeneratorInfo instanceof YangJavaEnumerationTranslator) { |
172 | /* | 171 | /* |
173 | * Enumeration | 172 | * Enumeration |
174 | */ | 173 | */ |
... | @@ -207,22 +206,22 @@ public final class YangJavaModelUtils { | ... | @@ -207,22 +206,22 @@ public final class YangJavaModelUtils { |
207 | * @param yangPluginConfig plugin configurations | 206 | * @param yangPluginConfig plugin configurations |
208 | * @throws IOException when fails to do IO operations | 207 | * @throws IOException when fails to do IO operations |
209 | */ | 208 | */ |
210 | - private static void updateNotificaitonNodeInfo(JavaCodeGeneratorInfo javaCodeGeneratorInfo, | 209 | + private static void updateNotificationNodeInfo(JavaCodeGeneratorInfo javaCodeGeneratorInfo, |
211 | YangPluginConfig yangPluginConfig) | 210 | YangPluginConfig yangPluginConfig) |
212 | throws IOException { | 211 | throws IOException { |
213 | - if (javaCodeGeneratorInfo instanceof YangJavaModule) { | 212 | + if (javaCodeGeneratorInfo instanceof YangJavaModuleTranslator) { |
214 | - for (YangNode notificaiton : ((YangJavaModule) javaCodeGeneratorInfo).getNotificationNodes()) { | 213 | + for (YangNode notification : ((YangJavaModuleTranslator) javaCodeGeneratorInfo).getNotificationNodes()) { |
215 | javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles() | 214 | javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles() |
216 | .getEventFragmentFiles() | 215 | .getEventFragmentFiles() |
217 | - .addJavaSnippetOfEvent(notificaiton, yangPluginConfig); | 216 | + .addJavaSnippetOfEvent(notification, yangPluginConfig); |
218 | } | 217 | } |
219 | } | 218 | } |
220 | - if (javaCodeGeneratorInfo instanceof YangJavaSubModule) { | 219 | + if (javaCodeGeneratorInfo instanceof YangJavaSubModuleTranslator) { |
221 | - for (YangNode notificaiton : ((YangJavaSubModule) javaCodeGeneratorInfo) | 220 | + for (YangNode notification : ((YangJavaSubModuleTranslator) javaCodeGeneratorInfo) |
222 | .getNotificationNodes()) { | 221 | .getNotificationNodes()) { |
223 | javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles() | 222 | javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles() |
224 | .getEventFragmentFiles() | 223 | .getEventFragmentFiles() |
225 | - .addJavaSnippetOfEvent(notificaiton, yangPluginConfig); | 224 | + .addJavaSnippetOfEvent(notification, yangPluginConfig); |
226 | } | 225 | } |
227 | } | 226 | } |
228 | } | 227 | } |
... | @@ -269,9 +268,9 @@ public final class YangJavaModelUtils { | ... | @@ -269,9 +268,9 @@ public final class YangJavaModelUtils { |
269 | 268 | ||
270 | generateCodeOfNode(javaCodeGeneratorInfo, yangPlugin); | 269 | generateCodeOfNode(javaCodeGeneratorInfo, yangPlugin); |
271 | TempJavaCodeFragmentFiles tempJavaCodeFragmentFiles = javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles(); | 270 | TempJavaCodeFragmentFiles tempJavaCodeFragmentFiles = javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles(); |
272 | - if (javaCodeGeneratorInfo instanceof YangJavaAugment) { | 271 | + if (javaCodeGeneratorInfo instanceof YangJavaAugmentTranslator) { |
273 | 272 | ||
274 | - JavaQualifiedTypeInfo yangAugmentedInfo = new JavaQualifiedTypeInfo(); | 273 | + JavaQualifiedTypeInfoTranslator yangAugmentedInfo = new JavaQualifiedTypeInfoTranslator(); |
275 | yangAugmentedInfo.setClassInfo(YANG_AUGMENTED_INFO); | 274 | yangAugmentedInfo.setClassInfo(YANG_AUGMENTED_INFO); |
276 | yangAugmentedInfo.setPkgInfo(YANG_AUGMENTED_INFO_CLASS_IMPORT_PKG); | 275 | yangAugmentedInfo.setPkgInfo(YANG_AUGMENTED_INFO_CLASS_IMPORT_PKG); |
277 | javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().getBeanTempFiles().getJavaExtendsListHolder() | 276 | javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().getBeanTempFiles().getJavaExtendsListHolder() |
... | @@ -280,7 +279,7 @@ public final class YangJavaModelUtils { | ... | @@ -280,7 +279,7 @@ public final class YangJavaModelUtils { |
280 | } | 279 | } |
281 | if (javaCodeGeneratorInfo instanceof YangCase) { | 280 | if (javaCodeGeneratorInfo instanceof YangCase) { |
282 | YangNode parent = ((YangCase) javaCodeGeneratorInfo).getParent(); | 281 | YangNode parent = ((YangCase) javaCodeGeneratorInfo).getParent(); |
283 | - JavaQualifiedTypeInfo parentsInfo = new JavaQualifiedTypeInfo(); | 282 | + JavaQualifiedTypeInfoTranslator parentsInfo = new JavaQualifiedTypeInfoTranslator(); |
284 | String parentName = getCapitalCase(((JavaFileInfoContainer) parent).getJavaFileInfo().getJavaName()); | 283 | String parentName = getCapitalCase(((JavaFileInfoContainer) parent).getJavaFileInfo().getJavaName()); |
285 | String parentPkg = ((JavaFileInfoContainer) parent).getJavaFileInfo().getPackage(); | 284 | String parentPkg = ((JavaFileInfoContainer) parent).getJavaFileInfo().getPackage(); |
286 | parentsInfo.setClassInfo(parentName); | 285 | parentsInfo.setClassInfo(parentName); |
... | @@ -399,7 +398,7 @@ public final class YangJavaModelUtils { | ... | @@ -399,7 +398,7 @@ public final class YangJavaModelUtils { |
399 | File codeGenDir = new File(info.getBaseCodeGenPath() | 398 | File codeGenDir = new File(info.getBaseCodeGenPath() |
400 | + info.getPackageFilePath()); | 399 | + info.getPackageFilePath()); |
401 | File[] files = codeGenDir.listFiles(); | 400 | File[] files = codeGenDir.listFiles(); |
402 | - if (files.length >= 1) { | 401 | + if (files != null && files.length >= 1) { |
403 | for (File file : files) { | 402 | for (File file : files) { |
404 | if (file.getName().contentEquals(getCapitalCase(info.getJavaName() + MANAGER + ".java"))) { | 403 | if (file.getName().contentEquals(getCapitalCase(info.getJavaName() + MANAGER + ".java"))) { |
405 | return false; | 404 | return false; |
... | @@ -420,36 +419,31 @@ public final class YangJavaModelUtils { | ... | @@ -420,36 +419,31 @@ public final class YangJavaModelUtils { |
420 | 419 | ||
421 | List<String> clsInfo = new ArrayList<>(); | 420 | List<String> clsInfo = new ArrayList<>(); |
422 | while (node.getParent() != null) { | 421 | while (node.getParent() != null) { |
423 | - if (!(node instanceof YangModule) | 422 | + if (node instanceof YangJavaAugmentTranslator) { |
424 | - || !(node instanceof YangSubModule)) { | ||
425 | - if (node instanceof YangJavaAugment) { | ||
426 | clsInfo.add(getAugmentClassName((YangAugment) node, yangPluginConfig)); | 423 | clsInfo.add(getAugmentClassName((YangAugment) node, yangPluginConfig)); |
427 | } else { | 424 | } else { |
428 | clsInfo.add(getCamelCase(node.getName(), yangPluginConfig.getConflictResolver())); | 425 | clsInfo.add(getCamelCase(node.getName(), yangPluginConfig.getConflictResolver())); |
429 | } | 426 | } |
430 | - } | 427 | + |
431 | - if (node instanceof YangJavaModule | ||
432 | - || node instanceof YangJavaSubModule) { | ||
433 | - break; | ||
434 | - } | ||
435 | node = node.getParent(); | 428 | node = node.getParent(); |
436 | } | 429 | } |
437 | 430 | ||
438 | StringBuilder pkg = new StringBuilder(); | 431 | StringBuilder pkg = new StringBuilder(); |
439 | - if (node instanceof YangJavaModule) { | 432 | + if (node instanceof YangJavaModuleTranslator) { |
440 | - YangJavaModule module = (YangJavaModule) node; | 433 | + YangJavaModuleTranslator module = (YangJavaModuleTranslator) node; |
441 | pkg.append(getRootPackage(module.getVersion(), module.getNameSpace().getUri(), module | 434 | pkg.append(getRootPackage(module.getVersion(), module.getNameSpace().getUri(), module |
442 | .getRevision().getRevDate(), yangPluginConfig.getConflictResolver())); | 435 | .getRevision().getRevDate(), yangPluginConfig.getConflictResolver())); |
443 | - } else if (node instanceof YangJavaSubModule) { | 436 | + } else if (node instanceof YangJavaSubModuleTranslator) { |
444 | - YangJavaSubModule submodule = (YangJavaSubModule) node; | 437 | + YangJavaSubModuleTranslator submodule = (YangJavaSubModuleTranslator) node; |
445 | pkg.append(getRootPackage(submodule.getVersion(), | 438 | pkg.append(getRootPackage(submodule.getVersion(), |
446 | submodule.getNameSpaceFromModule(submodule.getBelongsTo()), | 439 | submodule.getNameSpaceFromModule(submodule.getBelongsTo()), |
447 | submodule.getRevision().getRevDate(), yangPluginConfig.getConflictResolver())); | 440 | submodule.getRevision().getRevDate(), yangPluginConfig.getConflictResolver())); |
448 | } | 441 | } |
442 | + String concat = ""; | ||
449 | for (int i = 1; i <= clsInfo.size(); i++) { | 443 | for (int i = 1; i <= clsInfo.size(); i++) { |
450 | - pkg.append("." + clsInfo.get(clsInfo.size() - i)); | 444 | + concat = concat + "." + clsInfo.get(clsInfo.size() - i); |
451 | } | 445 | } |
452 | - | 446 | + pkg.append(concat); |
453 | return pkg.toString().toLowerCase(); | 447 | return pkg.toString().toLowerCase(); |
454 | 448 | ||
455 | } | 449 | } | ... | ... |
... | @@ -21,23 +21,22 @@ import java.util.Stack; | ... | @@ -21,23 +21,22 @@ import java.util.Stack; |
21 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; | 21 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; |
22 | import org.onosproject.yangutils.datamodel.YangEnumeration; | 22 | import org.onosproject.yangutils.datamodel.YangEnumeration; |
23 | import org.onosproject.yangutils.datamodel.YangIdentity; | 23 | import org.onosproject.yangutils.datamodel.YangIdentity; |
24 | -import org.onosproject.yangutils.datamodel.YangLeafRef; | ||
25 | import org.onosproject.yangutils.datamodel.YangIdentityRef; | 24 | import org.onosproject.yangutils.datamodel.YangIdentityRef; |
25 | +import org.onosproject.yangutils.datamodel.YangLeafRef; | ||
26 | import org.onosproject.yangutils.datamodel.YangNode; | 26 | import org.onosproject.yangutils.datamodel.YangNode; |
27 | import org.onosproject.yangutils.datamodel.YangType; | 27 | import org.onosproject.yangutils.datamodel.YangType; |
28 | -import org.onosproject.yangutils.datamodel.YangTypeDef; | ||
29 | import org.onosproject.yangutils.datamodel.YangUnion; | 28 | import org.onosproject.yangutils.datamodel.YangUnion; |
29 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; | ||
30 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangToJavaNamingConflictUtil; | ||
30 | import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; | 31 | import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
31 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 32 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
32 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 33 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
33 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
34 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; | 34 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; |
35 | -import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil; | ||
36 | 35 | ||
37 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.getCurNodePackage; | 36 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.getCurNodePackage; |
38 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage; | 37 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage; |
39 | -import static org.onosproject.yangutils.utils.UtilConstants.BIG_INTEGER; | ||
40 | import static org.onosproject.yangutils.utils.UtilConstants.BIG_DECIMAL; | 38 | import static org.onosproject.yangutils.utils.UtilConstants.BIG_DECIMAL; |
39 | +import static org.onosproject.yangutils.utils.UtilConstants.BIG_INTEGER; | ||
41 | import static org.onosproject.yangutils.utils.UtilConstants.BIT_SET; | 40 | import static org.onosproject.yangutils.utils.UtilConstants.BIT_SET; |
42 | import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_DATA_TYPE; | 41 | import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_DATA_TYPE; |
43 | import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_WRAPPER; | 42 | import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_WRAPPER; |
... | @@ -155,7 +154,7 @@ public final class AttributesJavaDataType { | ... | @@ -155,7 +154,7 @@ public final class AttributesJavaDataType { |
155 | return BOOLEAN_WRAPPER; | 154 | return BOOLEAN_WRAPPER; |
156 | case ENUMERATION: | 155 | case ENUMERATION: |
157 | return getCapitalCase( | 156 | return getCapitalCase( |
158 | - getCamelCase(((YangJavaEnumeration) yangType.getDataTypeExtendedInfo()).getName(), | 157 | + getCamelCase(((YangJavaEnumerationTranslator) yangType.getDataTypeExtendedInfo()).getName(), |
159 | pluginConfig)); | 158 | pluginConfig)); |
160 | case BITS: | 159 | case BITS: |
161 | return BIT_SET; | 160 | return BIT_SET; |
... | @@ -163,17 +162,17 @@ public final class AttributesJavaDataType { | ... | @@ -163,17 +162,17 @@ public final class AttributesJavaDataType { |
163 | return BYTE + SQUARE_BRACKETS; | 162 | return BYTE + SQUARE_BRACKETS; |
164 | case LEAFREF: | 163 | case LEAFREF: |
165 | YangType<?> referredType = getReferredTypeFromLeafref(yangType); | 164 | YangType<?> referredType = getReferredTypeFromLeafref(yangType); |
166 | - return getJavaImportClass(referredType, isListAttr, pluginConfig); | 165 | + return getJavaImportClass(referredType, true, pluginConfig); |
167 | case IDENTITYREF: | 166 | case IDENTITYREF: |
168 | YangIdentityRef identityRef = (YangIdentityRef) yangType.getDataTypeExtendedInfo(); | 167 | YangIdentityRef identityRef = (YangIdentityRef) yangType.getDataTypeExtendedInfo(); |
169 | YangIdentity identity = identityRef.getReferredIdentity(); | 168 | YangIdentity identity = identityRef.getReferredIdentity(); |
170 | - return getCapitalCase(getCamelCase(((YangJavaIdentity) identity). | 169 | + return getCapitalCase(getCamelCase(identity. |
171 | getName(), pluginConfig)); | 170 | getName(), pluginConfig)); |
172 | case EMPTY: | 171 | case EMPTY: |
173 | return BOOLEAN_WRAPPER; | 172 | return BOOLEAN_WRAPPER; |
174 | case UNION: | 173 | case UNION: |
175 | - return getCapitalCase(getCamelCase(((YangJavaUnion) yangType.getDataTypeExtendedInfo()).getName(), | 174 | + return getCapitalCase(getCamelCase(((YangJavaUnionTranslator) yangType |
176 | - pluginConfig)); | 175 | + .getDataTypeExtendedInfo()).getName(), pluginConfig)); |
177 | case INSTANCE_IDENTIFIER: | 176 | case INSTANCE_IDENTIFIER: |
178 | return STRING_DATA_TYPE; | 177 | return STRING_DATA_TYPE; |
179 | case DERIVED: | 178 | case DERIVED: |
... | @@ -190,7 +189,7 @@ public final class AttributesJavaDataType { | ... | @@ -190,7 +189,7 @@ public final class AttributesJavaDataType { |
190 | return STRING_DATA_TYPE; | 189 | return STRING_DATA_TYPE; |
191 | case ENUMERATION: | 190 | case ENUMERATION: |
192 | return getCapitalCase( | 191 | return getCapitalCase( |
193 | - getCamelCase(((YangJavaEnumeration) yangType.getDataTypeExtendedInfo()).getName(), | 192 | + getCamelCase(((YangJavaEnumerationTranslator) yangType.getDataTypeExtendedInfo()).getName(), |
194 | pluginConfig)); | 193 | pluginConfig)); |
195 | case BITS: | 194 | case BITS: |
196 | return BIT_SET; | 195 | return BIT_SET; |
... | @@ -198,16 +197,16 @@ public final class AttributesJavaDataType { | ... | @@ -198,16 +197,16 @@ public final class AttributesJavaDataType { |
198 | return BIG_DECIMAL; | 197 | return BIG_DECIMAL; |
199 | case LEAFREF: | 198 | case LEAFREF: |
200 | YangType<?> referredType = getReferredTypeFromLeafref(yangType); | 199 | YangType<?> referredType = getReferredTypeFromLeafref(yangType); |
201 | - return getJavaImportClass(referredType, isListAttr, pluginConfig); | 200 | + return getJavaImportClass(referredType, false, pluginConfig); |
202 | case IDENTITYREF: | 201 | case IDENTITYREF: |
203 | YangIdentityRef identityRef = (YangIdentityRef) yangType.getDataTypeExtendedInfo(); | 202 | YangIdentityRef identityRef = (YangIdentityRef) yangType.getDataTypeExtendedInfo(); |
204 | YangIdentity identity = identityRef.getReferredIdentity(); | 203 | YangIdentity identity = identityRef.getReferredIdentity(); |
205 | - return getCapitalCase(getCamelCase(((YangJavaIdentity) identity).getName(), pluginConfig)); | 204 | + return getCapitalCase(getCamelCase(identity.getName(), pluginConfig)); |
206 | case EMPTY: | 205 | case EMPTY: |
207 | return BOOLEAN_DATA_TYPE; | 206 | return BOOLEAN_DATA_TYPE; |
208 | case UNION: | 207 | case UNION: |
209 | - return getCapitalCase(getCamelCase(((YangJavaUnion) yangType.getDataTypeExtendedInfo()).getName(), | 208 | + return getCapitalCase(getCamelCase(((YangJavaUnionTranslator) yangType |
210 | - pluginConfig)); | 209 | + .getDataTypeExtendedInfo()).getName(), pluginConfig)); |
211 | case INSTANCE_IDENTIFIER: | 210 | case INSTANCE_IDENTIFIER: |
212 | return STRING_DATA_TYPE; | 211 | return STRING_DATA_TYPE; |
213 | case DERIVED: | 212 | case DERIVED: |
... | @@ -255,7 +254,7 @@ public final class AttributesJavaDataType { | ... | @@ -255,7 +254,7 @@ public final class AttributesJavaDataType { |
255 | return COLLECTION_IMPORTS; | 254 | return COLLECTION_IMPORTS; |
256 | case LEAFREF: | 255 | case LEAFREF: |
257 | YangType<?> referredType = getReferredTypeFromLeafref(yangType); | 256 | YangType<?> referredType = getReferredTypeFromLeafref(yangType); |
258 | - return getJavaImportPackage(referredType, isListAttr, conflictResolver); | 257 | + return getJavaImportPackage(referredType, true, conflictResolver); |
259 | case IDENTITYREF: | 258 | case IDENTITYREF: |
260 | return getIdentityRefPackage(yangType, conflictResolver); | 259 | return getIdentityRefPackage(yangType, conflictResolver); |
261 | case UNION: | 260 | case UNION: |
... | @@ -281,7 +280,7 @@ public final class AttributesJavaDataType { | ... | @@ -281,7 +280,7 @@ public final class AttributesJavaDataType { |
281 | return COLLECTION_IMPORTS; | 280 | return COLLECTION_IMPORTS; |
282 | case LEAFREF: | 281 | case LEAFREF: |
283 | YangType<?> referredType = getReferredTypeFromLeafref(yangType); | 282 | YangType<?> referredType = getReferredTypeFromLeafref(yangType); |
284 | - return getJavaImportPackage(referredType, isListAttr, conflictResolver); | 283 | + return getJavaImportPackage(referredType, false, conflictResolver); |
285 | case IDENTITYREF: | 284 | case IDENTITYREF: |
286 | return getIdentityRefPackage(yangType, conflictResolver); | 285 | return getIdentityRefPackage(yangType, conflictResolver); |
287 | case UNION: | 286 | case UNION: |
... | @@ -309,11 +308,11 @@ public final class AttributesJavaDataType { | ... | @@ -309,11 +308,11 @@ public final class AttributesJavaDataType { |
309 | throw new TranslatorException("type should have been derived."); | 308 | throw new TranslatorException("type should have been derived."); |
310 | } | 309 | } |
311 | 310 | ||
312 | - if (!(((YangDerivedInfo<?>) var).getReferredTypeDef() instanceof YangTypeDef)) { | 311 | + if (!(((YangDerivedInfo<?>) var).getReferredTypeDef() != null)) { |
313 | throw new TranslatorException("derived info is not an instance of typedef."); | 312 | throw new TranslatorException("derived info is not an instance of typedef."); |
314 | } | 313 | } |
315 | 314 | ||
316 | - YangJavaTypeDef typedef = (YangJavaTypeDef) ((YangDerivedInfo<?>) var).getReferredTypeDef(); | 315 | + YangJavaTypeDefTranslator typedef = (YangJavaTypeDefTranslator) ((YangDerivedInfo<?>) var).getReferredTypeDef(); |
317 | if (typedef.getJavaFileInfo().getPackage() == null) { | 316 | if (typedef.getJavaFileInfo().getPackage() == null) { |
318 | return getPackageFromParent(typedef.getParent(), conflictResolver); | 317 | return getPackageFromParent(typedef.getParent(), conflictResolver); |
319 | } | 318 | } |
... | @@ -333,7 +332,7 @@ public final class AttributesJavaDataType { | ... | @@ -333,7 +332,7 @@ public final class AttributesJavaDataType { |
333 | throw new TranslatorException("type should have been union."); | 332 | throw new TranslatorException("type should have been union."); |
334 | } | 333 | } |
335 | 334 | ||
336 | - YangJavaUnion union = (YangJavaUnion) type.getDataTypeExtendedInfo(); | 335 | + YangJavaUnionTranslator union = (YangJavaUnionTranslator) type.getDataTypeExtendedInfo(); |
337 | if (union.getJavaFileInfo().getPackage() == null) { | 336 | if (union.getJavaFileInfo().getPackage() == null) { |
338 | return getPackageFromParent(union.getParent(), conflictResolver); | 337 | return getPackageFromParent(union.getParent(), conflictResolver); |
339 | } | 338 | } |
... | @@ -352,7 +351,7 @@ public final class AttributesJavaDataType { | ... | @@ -352,7 +351,7 @@ public final class AttributesJavaDataType { |
352 | if (!(type.getDataTypeExtendedInfo() instanceof YangEnumeration)) { | 351 | if (!(type.getDataTypeExtendedInfo() instanceof YangEnumeration)) { |
353 | throw new TranslatorException("type should have been enumeration."); | 352 | throw new TranslatorException("type should have been enumeration."); |
354 | } | 353 | } |
355 | - YangJavaEnumeration enumeration = (YangJavaEnumeration) type.getDataTypeExtendedInfo(); | 354 | + YangJavaEnumerationTranslator enumeration = (YangJavaEnumerationTranslator) type.getDataTypeExtendedInfo(); |
356 | if (enumeration.getJavaFileInfo().getPackage() == null) { | 355 | if (enumeration.getJavaFileInfo().getPackage() == null) { |
357 | return getPackageFromParent(enumeration.getParent(), conflictResolver); | 356 | return getPackageFromParent(enumeration.getParent(), conflictResolver); |
358 | } | 357 | } |
... | @@ -372,12 +371,13 @@ public final class AttributesJavaDataType { | ... | @@ -372,12 +371,13 @@ public final class AttributesJavaDataType { |
372 | throw new TranslatorException("type should have been identityref."); | 371 | throw new TranslatorException("type should have been identityref."); |
373 | } | 372 | } |
374 | YangIdentityRef identityRef = (YangIdentityRef) type.getDataTypeExtendedInfo(); | 373 | YangIdentityRef identityRef = (YangIdentityRef) type.getDataTypeExtendedInfo(); |
375 | - YangJavaIdentity identity = (YangJavaIdentity) (identityRef.getReferredIdentity()); | 374 | + YangJavaIdentityTranslator identity = (YangJavaIdentityTranslator) (identityRef.getReferredIdentity()); |
376 | if (identity.getJavaFileInfo().getPackage() == null) { | 375 | if (identity.getJavaFileInfo().getPackage() == null) { |
377 | return getPackageFromParent(identity.getParent(), conflictResolver); | 376 | return getPackageFromParent(identity.getParent(), conflictResolver); |
378 | } | 377 | } |
379 | return identity.getJavaFileInfo().getPackage(); | 378 | return identity.getJavaFileInfo().getPackage(); |
380 | } | 379 | } |
380 | + | ||
381 | /** | 381 | /** |
382 | * Returns package from parent node. | 382 | * Returns package from parent node. |
383 | * | 383 | * |
... | @@ -406,7 +406,7 @@ public final class AttributesJavaDataType { | ... | @@ -406,7 +406,7 @@ public final class AttributesJavaDataType { |
406 | */ | 406 | */ |
407 | public static void updateJavaFileInfo(YangNode yangNode, | 407 | public static void updateJavaFileInfo(YangNode yangNode, |
408 | YangToJavaNamingConflictUtil conflictResolver) { | 408 | YangToJavaNamingConflictUtil conflictResolver) { |
409 | - Stack<YangNode> nodesToUpdatePackage = new Stack<YangNode>(); | 409 | + Stack<YangNode> nodesToUpdatePackage = new Stack<>(); |
410 | 410 | ||
411 | /* | 411 | /* |
412 | * Add the nodes to be updated for package info in a stack. | 412 | * Add the nodes to be updated for package info in a stack. |
... | @@ -425,12 +425,12 @@ public final class AttributesJavaDataType { | ... | @@ -425,12 +425,12 @@ public final class AttributesJavaDataType { |
425 | if (yangNode == null) { | 425 | if (yangNode == null) { |
426 | yangNode = nodesToUpdatePackage.pop(); | 426 | yangNode = nodesToUpdatePackage.pop(); |
427 | String pkg; | 427 | String pkg; |
428 | - if (yangNode instanceof YangJavaModule) { | 428 | + if (yangNode instanceof YangJavaModuleTranslator) { |
429 | - YangJavaModule module = (YangJavaModule) yangNode; | 429 | + YangJavaModuleTranslator module = (YangJavaModuleTranslator) yangNode; |
430 | pkg = getRootPackage(module.getVersion(), module.getNameSpace().getUri(), module | 430 | pkg = getRootPackage(module.getVersion(), module.getNameSpace().getUri(), module |
431 | .getRevision().getRevDate(), conflictResolver); | 431 | .getRevision().getRevDate(), conflictResolver); |
432 | - } else if (yangNode instanceof YangJavaSubModule) { | 432 | + } else if (yangNode instanceof YangJavaSubModuleTranslator) { |
433 | - YangJavaSubModule submodule = (YangJavaSubModule) yangNode; | 433 | + YangJavaSubModuleTranslator submodule = (YangJavaSubModuleTranslator) yangNode; |
434 | pkg = getRootPackage(submodule.getVersion(), | 434 | pkg = getRootPackage(submodule.getVersion(), |
435 | submodule.getNameSpaceFromModule(submodule.getBelongsTo()), | 435 | submodule.getNameSpaceFromModule(submodule.getBelongsTo()), |
436 | submodule.getRevision().getRevDate(), conflictResolver); | 436 | submodule.getRevision().getRevDate(), conflictResolver); |
... | @@ -448,7 +448,7 @@ public final class AttributesJavaDataType { | ... | @@ -448,7 +448,7 @@ public final class AttributesJavaDataType { |
448 | .getPackage())); | 448 | .getPackage())); |
449 | } | 449 | } |
450 | 450 | ||
451 | - /** | 451 | + /* |
452 | * Parent of the node in stack is updated with java info, | 452 | * Parent of the node in stack is updated with java info, |
453 | * all the nodes can be popped and updated | 453 | * all the nodes can be popped and updated |
454 | */ | 454 | */ | ... | ... |
... | @@ -17,7 +17,7 @@ package org.onosproject.yangutils.translator.tojava.javamodel; | ... | @@ -17,7 +17,7 @@ package org.onosproject.yangutils.translator.tojava.javamodel; |
17 | 17 | ||
18 | import org.onosproject.yangutils.datamodel.YangType; | 18 | import org.onosproject.yangutils.datamodel.YangType; |
19 | import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoContainer; | 19 | import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoContainer; |
20 | -import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil; | 20 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangToJavaNamingConflictUtil; |
21 | 21 | ||
22 | /** | 22 | /** |
23 | * Represent java based identification of the YANG leaves. | 23 | * Represent java based identification of the YANG leaves. | ... | ... |
... | @@ -15,8 +15,8 @@ | ... | @@ -15,8 +15,8 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.yangutils.translator.tojava.javamodel; | 16 | package org.onosproject.yangutils.translator.tojava.javamodel; |
17 | 17 | ||
18 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangToJavaNamingConflictUtil; | ||
18 | import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoContainer; | 19 | import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoContainer; |
19 | -import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil; | ||
20 | 20 | ||
21 | /** | 21 | /** |
22 | * Represent java based identification of the YANG leaves. | 22 | * Represent java based identification of the YANG leaves. |
... | @@ -27,7 +27,7 @@ public interface JavaQualifiedTypeResolver | ... | @@ -27,7 +27,7 @@ public interface JavaQualifiedTypeResolver |
27 | /** | 27 | /** |
28 | * updates the qualified access details of the type. | 28 | * updates the qualified access details of the type. |
29 | * | 29 | * |
30 | - * @param confilictResolver plugin configurations | 30 | + * @param conflictResolver plugin configurations |
31 | */ | 31 | */ |
32 | - void updateJavaQualifiedInfo(YangToJavaNamingConflictUtil confilictResolver); | 32 | + void updateJavaQualifiedInfo(YangToJavaNamingConflictUtil conflictResolver); |
33 | } | 33 | } | ... | ... |
... | @@ -17,13 +17,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; | ... | @@ -17,13 +17,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; |
17 | 17 | ||
18 | import java.io.IOException; | 18 | import java.io.IOException; |
19 | 19 | ||
20 | -import org.onosproject.yangutils.datamodel.YangAugment; | 20 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
21 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaAugment; | ||
22 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
21 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 23 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
22 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 24 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
23 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 25 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
24 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
25 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 26 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
26 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
27 | 27 | ||
28 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; | 28 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; |
29 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfAugmentableNode; | 29 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfAugmentableNode; |
... | @@ -31,18 +31,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen | ... | @@ -31,18 +31,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen |
31 | /** | 31 | /** |
32 | * Represents augment information extended to support java code generation. | 32 | * Represents augment information extended to support java code generation. |
33 | */ | 33 | */ |
34 | -public class YangJavaAugment | 34 | +public class YangJavaAugmentTranslator |
35 | - extends YangAugment | 35 | + extends YangJavaAugment |
36 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { | 36 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { |
37 | 37 | ||
38 | private static final long serialVersionUID = 806201632L; | 38 | private static final long serialVersionUID = 806201632L; |
39 | 39 | ||
40 | /** | 40 | /** |
41 | - * Contains the information of the java file being generated. | ||
42 | - */ | ||
43 | - private JavaFileInfo javaFileInfo; | ||
44 | - | ||
45 | - /** | ||
46 | * File handle to maintain temporary java code fragments as per the code snippet types. | 41 | * File handle to maintain temporary java code fragments as per the code snippet types. |
47 | */ | 42 | */ |
48 | private transient TempJavaCodeFragmentFiles tempFileHandle; | 43 | private transient TempJavaCodeFragmentFiles tempFileHandle; |
... | @@ -50,7 +45,7 @@ public class YangJavaAugment | ... | @@ -50,7 +45,7 @@ public class YangJavaAugment |
50 | /** | 45 | /** |
51 | * Creates a YANG java augment object. | 46 | * Creates a YANG java augment object. |
52 | */ | 47 | */ |
53 | - public YangJavaAugment() { | 48 | + public YangJavaAugmentTranslator() { |
54 | super(); | 49 | super(); |
55 | setJavaFileInfo(new JavaFileInfo()); | 50 | setJavaFileInfo(new JavaFileInfo()); |
56 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); | 51 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); | ... | ... |
... | @@ -17,13 +17,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; | ... | @@ -17,13 +17,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; |
17 | 17 | ||
18 | import java.io.IOException; | 18 | import java.io.IOException; |
19 | 19 | ||
20 | -import org.onosproject.yangutils.datamodel.YangCase; | 20 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
21 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaCase; | ||
22 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
21 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 23 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
22 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 24 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
23 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 25 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
24 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
25 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 26 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
26 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
27 | 27 | ||
28 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; | 28 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; |
29 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfAugmentableNode; | 29 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfAugmentableNode; |
... | @@ -31,18 +31,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen | ... | @@ -31,18 +31,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen |
31 | /** | 31 | /** |
32 | * Represents case information extended to support java code generation. | 32 | * Represents case information extended to support java code generation. |
33 | */ | 33 | */ |
34 | -public class YangJavaCase | 34 | +public class YangJavaCaseTranslator |
35 | - extends YangCase | 35 | + extends YangJavaCase |
36 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { | 36 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { |
37 | 37 | ||
38 | private static final long serialVersionUID = 806201631L; | 38 | private static final long serialVersionUID = 806201631L; |
39 | 39 | ||
40 | /** | 40 | /** |
41 | - * Contains the information of the java file being generated. | ||
42 | - */ | ||
43 | - private JavaFileInfo javaFileInfo; | ||
44 | - | ||
45 | - /** | ||
46 | * File handle to maintain temporary java code fragments as per the code | 41 | * File handle to maintain temporary java code fragments as per the code |
47 | * snippet types. | 42 | * snippet types. |
48 | */ | 43 | */ |
... | @@ -51,7 +46,7 @@ public class YangJavaCase | ... | @@ -51,7 +46,7 @@ public class YangJavaCase |
51 | /** | 46 | /** |
52 | * Creates YANG java case object. | 47 | * Creates YANG java case object. |
53 | */ | 48 | */ |
54 | - public YangJavaCase() { | 49 | + public YangJavaCaseTranslator() { |
55 | super(); | 50 | super(); |
56 | setJavaFileInfo(new JavaFileInfo()); | 51 | setJavaFileInfo(new JavaFileInfo()); |
57 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); | 52 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); | ... | ... |
... | @@ -17,13 +17,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; | ... | @@ -17,13 +17,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; |
17 | 17 | ||
18 | import java.io.IOException; | 18 | import java.io.IOException; |
19 | 19 | ||
20 | -import org.onosproject.yangutils.datamodel.YangChoice; | 20 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
21 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaChoice; | ||
22 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
21 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 23 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
22 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 24 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
23 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 25 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
24 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
25 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 26 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
26 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
27 | 27 | ||
28 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.INTERFACE_MASK; | 28 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.INTERFACE_MASK; |
29 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeAndUpdateInParent; | 29 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeAndUpdateInParent; |
... | @@ -31,18 +31,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen | ... | @@ -31,18 +31,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen |
31 | /** | 31 | /** |
32 | * Represents choice information extended to support java code generation. | 32 | * Represents choice information extended to support java code generation. |
33 | */ | 33 | */ |
34 | -public class YangJavaChoice | 34 | +public class YangJavaChoiceTranslator |
35 | - extends YangChoice | 35 | + extends YangJavaChoice |
36 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { | 36 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { |
37 | 37 | ||
38 | private static final long serialVersionUID = 806201631L; | 38 | private static final long serialVersionUID = 806201631L; |
39 | 39 | ||
40 | /** | 40 | /** |
41 | - * Contains the information of the java file being generated. | ||
42 | - */ | ||
43 | - private JavaFileInfo javaFileInfo; | ||
44 | - | ||
45 | - /** | ||
46 | * File handle to maintain temporary java code fragments as per the code | 41 | * File handle to maintain temporary java code fragments as per the code |
47 | * snippet types. | 42 | * snippet types. |
48 | */ | 43 | */ |
... | @@ -51,7 +46,7 @@ public class YangJavaChoice | ... | @@ -51,7 +46,7 @@ public class YangJavaChoice |
51 | /** | 46 | /** |
52 | * Creates YANG java choice object. | 47 | * Creates YANG java choice object. |
53 | */ | 48 | */ |
54 | - public YangJavaChoice() { | 49 | + public YangJavaChoiceTranslator() { |
55 | super(); | 50 | super(); |
56 | setJavaFileInfo(new JavaFileInfo()); | 51 | setJavaFileInfo(new JavaFileInfo()); |
57 | getJavaFileInfo().setGeneratedFileTypes(INTERFACE_MASK); | 52 | getJavaFileInfo().setGeneratedFileTypes(INTERFACE_MASK); | ... | ... |
... | @@ -17,13 +17,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; | ... | @@ -17,13 +17,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; |
17 | 17 | ||
18 | import java.io.IOException; | 18 | import java.io.IOException; |
19 | 19 | ||
20 | -import org.onosproject.yangutils.datamodel.YangContainer; | 20 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
21 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaContainer; | ||
22 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
21 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 23 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
22 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 24 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
23 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 25 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
24 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
25 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 26 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
26 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
27 | 27 | ||
28 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; | 28 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; |
29 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeAndUpdateInParent; | 29 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeAndUpdateInParent; |
... | @@ -31,18 +31,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen | ... | @@ -31,18 +31,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen |
31 | /** | 31 | /** |
32 | * Represents container information extended to support java code generation. | 32 | * Represents container information extended to support java code generation. |
33 | */ | 33 | */ |
34 | -public class YangJavaContainer | 34 | +public class YangJavaContainerTranslator |
35 | - extends YangContainer | 35 | + extends YangJavaContainer |
36 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { | 36 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { |
37 | 37 | ||
38 | private static final long serialVersionUID = 806201630L; | 38 | private static final long serialVersionUID = 806201630L; |
39 | 39 | ||
40 | /** | 40 | /** |
41 | - * Contains the information of the java file being generated. | ||
42 | - */ | ||
43 | - private JavaFileInfo javaFileInfo; | ||
44 | - | ||
45 | - /** | ||
46 | * File handle to maintain temporary java code fragments as per the code | 41 | * File handle to maintain temporary java code fragments as per the code |
47 | * snippet types. | 42 | * snippet types. |
48 | */ | 43 | */ |
... | @@ -51,7 +46,7 @@ public class YangJavaContainer | ... | @@ -51,7 +46,7 @@ public class YangJavaContainer |
51 | /** | 46 | /** |
52 | * Creates YANG java container object. | 47 | * Creates YANG java container object. |
53 | */ | 48 | */ |
54 | - public YangJavaContainer() { | 49 | + public YangJavaContainerTranslator() { |
55 | super(); | 50 | super(); |
56 | setJavaFileInfo(new JavaFileInfo()); | 51 | setJavaFileInfo(new JavaFileInfo()); |
57 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); | 52 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); | ... | ... |
... | @@ -18,13 +18,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; | ... | @@ -18,13 +18,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; |
18 | 18 | ||
19 | import java.io.IOException; | 19 | import java.io.IOException; |
20 | 20 | ||
21 | -import org.onosproject.yangutils.datamodel.YangEnumeration; | 21 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
22 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaEnumeration; | ||
23 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
22 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 24 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
23 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 25 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
24 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 26 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
25 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
26 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 27 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
27 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
28 | 28 | ||
29 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ENUM_CLASS; | 29 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ENUM_CLASS; |
30 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfNode; | 30 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfNode; |
... | @@ -32,18 +32,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen | ... | @@ -32,18 +32,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen |
32 | /** | 32 | /** |
33 | * Represents YANG java enumeration information extended to support java code generation. | 33 | * Represents YANG java enumeration information extended to support java code generation. |
34 | */ | 34 | */ |
35 | -public class YangJavaEnumeration | 35 | +public class YangJavaEnumerationTranslator |
36 | - extends YangEnumeration | 36 | + extends YangJavaEnumeration |
37 | implements JavaCodeGenerator, JavaCodeGeneratorInfo { | 37 | implements JavaCodeGenerator, JavaCodeGeneratorInfo { |
38 | 38 | ||
39 | private static final long serialVersionUID = 806201629L; | 39 | private static final long serialVersionUID = 806201629L; |
40 | 40 | ||
41 | /** | 41 | /** |
42 | - * Contains the information of the java file being generated. | ||
43 | - */ | ||
44 | - private JavaFileInfo javaFileInfo; | ||
45 | - | ||
46 | - /** | ||
47 | * File handle to maintain temporary java code fragments as per the code | 42 | * File handle to maintain temporary java code fragments as per the code |
48 | * snippet types. | 43 | * snippet types. |
49 | */ | 44 | */ |
... | @@ -52,7 +47,7 @@ public class YangJavaEnumeration | ... | @@ -52,7 +47,7 @@ public class YangJavaEnumeration |
52 | /** | 47 | /** |
53 | * Creates YANG java enumeration object. | 48 | * Creates YANG java enumeration object. |
54 | */ | 49 | */ |
55 | - public YangJavaEnumeration() { | 50 | + public YangJavaEnumerationTranslator() { |
56 | super(); | 51 | super(); |
57 | setJavaFileInfo(new JavaFileInfo()); | 52 | setJavaFileInfo(new JavaFileInfo()); |
58 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_ENUM_CLASS); | 53 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_ENUM_CLASS); | ... | ... |
... | @@ -15,30 +15,25 @@ | ... | @@ -15,30 +15,25 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.yangutils.translator.tojava.javamodel; | 16 | package org.onosproject.yangutils.translator.tojava.javamodel; |
17 | 17 | ||
18 | -import org.onosproject.yangutils.datamodel.YangGrouping; | 18 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
19 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaGrouping; | ||
20 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
19 | import org.onosproject.yangutils.translator.exception.InvalidNodeForTranslatorException; | 21 | import org.onosproject.yangutils.translator.exception.InvalidNodeForTranslatorException; |
20 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 22 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
21 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 23 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
22 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 24 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
23 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
24 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 25 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
25 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
26 | 26 | ||
27 | /** | 27 | /** |
28 | * Represents grouping information extended to support java code generation. | 28 | * Represents grouping information extended to support java code generation. |
29 | */ | 29 | */ |
30 | -public class YangJavaGrouping | 30 | +public class YangJavaGroupingTranslator |
31 | - extends YangGrouping | 31 | + extends YangJavaGrouping |
32 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { | 32 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { |
33 | 33 | ||
34 | private static final long serialVersionUID = 806201628L; | 34 | private static final long serialVersionUID = 806201628L; |
35 | 35 | ||
36 | /** | 36 | /** |
37 | - * Contains the information of the java file being generated. | ||
38 | - */ | ||
39 | - private JavaFileInfo javaFileInfo; | ||
40 | - | ||
41 | - /** | ||
42 | * File handle to maintain temporary java code fragments as per the code | 37 | * File handle to maintain temporary java code fragments as per the code |
43 | * snippet types. | 38 | * snippet types. |
44 | */ | 39 | */ |
... | @@ -47,7 +42,7 @@ public class YangJavaGrouping | ... | @@ -47,7 +42,7 @@ public class YangJavaGrouping |
47 | /** | 42 | /** |
48 | * Creates YANG Java grouping object. | 43 | * Creates YANG Java grouping object. |
49 | */ | 44 | */ |
50 | - public YangJavaGrouping() { | 45 | + public YangJavaGroupingTranslator() { |
51 | super(); | 46 | super(); |
52 | setJavaFileInfo(new JavaFileInfo()); | 47 | setJavaFileInfo(new JavaFileInfo()); |
53 | } | 48 | } | ... | ... |
... | @@ -19,15 +19,15 @@ import java.io.File; | ... | @@ -19,15 +19,15 @@ import java.io.File; |
19 | import java.io.IOException; | 19 | import java.io.IOException; |
20 | import java.util.List; | 20 | import java.util.List; |
21 | 21 | ||
22 | -import org.onosproject.yangutils.datamodel.YangIdentity; | 22 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
23 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaIdentity; | ||
24 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
23 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 25 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
24 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 26 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
25 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 27 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
26 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
27 | import org.onosproject.yangutils.translator.tojava.JavaImportData; | 28 | import org.onosproject.yangutils.translator.tojava.JavaImportData; |
28 | -import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; | 29 | +import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator; |
29 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 30 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
30 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
31 | 31 | ||
32 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_IDENTITY_CLASS; | 32 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_IDENTITY_CLASS; |
33 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; | 33 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; |
... | @@ -41,16 +41,12 @@ import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase | ... | @@ -41,16 +41,12 @@ import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase |
41 | /** | 41 | /** |
42 | * Represents input information extended to support java code generation. | 42 | * Represents input information extended to support java code generation. |
43 | */ | 43 | */ |
44 | -public class YangJavaIdentity extends YangIdentity | 44 | +public class YangJavaIdentityTranslator extends YangJavaIdentity |
45 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { | 45 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { |
46 | 46 | ||
47 | //File type extension for java classes. | 47 | //File type extension for java classes. |
48 | private static final String JAVA_FILE_EXTENSION = ".java"; | 48 | private static final String JAVA_FILE_EXTENSION = ".java"; |
49 | 49 | ||
50 | - | ||
51 | - //Contains the information of the java file being generated. | ||
52 | - private JavaFileInfo javaFileInfo; | ||
53 | - | ||
54 | //Contains the information of the importd. | 50 | //Contains the information of the importd. |
55 | private transient JavaImportData importData; | 51 | private transient JavaImportData importData; |
56 | 52 | ||
... | @@ -58,12 +54,12 @@ public class YangJavaIdentity extends YangIdentity | ... | @@ -58,12 +54,12 @@ public class YangJavaIdentity extends YangIdentity |
58 | * File handle to maintain temporary java code fragments as per the code | 54 | * File handle to maintain temporary java code fragments as per the code |
59 | * snippet types. | 55 | * snippet types. |
60 | */ | 56 | */ |
61 | - private TempJavaCodeFragmentFiles tempFileHandle; | 57 | + private transient TempJavaCodeFragmentFiles tempFileHandle; |
62 | 58 | ||
63 | /** | 59 | /** |
64 | * Creates YANG java container object. | 60 | * Creates YANG java container object. |
65 | */ | 61 | */ |
66 | - public YangJavaIdentity() { | 62 | + public YangJavaIdentityTranslator() { |
67 | setJavaFileInfo(new JavaFileInfo()); | 63 | setJavaFileInfo(new JavaFileInfo()); |
68 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); | 64 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); |
69 | importData = new JavaImportData(); | 65 | importData = new JavaImportData(); |
... | @@ -123,18 +119,19 @@ public class YangJavaIdentity extends YangIdentity | ... | @@ -123,18 +119,19 @@ public class YangJavaIdentity extends YangIdentity |
123 | public void generateCodeEntry(YangPluginConfig yangPlugin) throws TranslatorException { | 119 | public void generateCodeEntry(YangPluginConfig yangPlugin) throws TranslatorException { |
124 | try { | 120 | try { |
125 | updatePackageInfo(this, yangPlugin); | 121 | updatePackageInfo(this, yangPlugin); |
126 | - JavaQualifiedTypeInfo basePkgInfo = new JavaQualifiedTypeInfo(); | 122 | + JavaQualifiedTypeInfoTranslator basePkgInfo = new JavaQualifiedTypeInfoTranslator(); |
127 | String className = getCapitalCase(getJavaFileInfo().getJavaName()); | 123 | String className = getCapitalCase(getJavaFileInfo().getJavaName()); |
128 | String path = getJavaFileInfo().getPackageFilePath(); | 124 | String path = getJavaFileInfo().getPackageFilePath(); |
129 | createPackage(this); | 125 | createPackage(this); |
130 | List<String> imports = null; | 126 | List<String> imports = null; |
131 | - boolean isQualified = false; | 127 | + boolean isQualified; |
132 | 128 | ||
133 | if (getBaseNode() != null && getBaseNode().getReferredIdentity() != null) { | 129 | if (getBaseNode() != null && getBaseNode().getReferredIdentity() != null) { |
134 | - if (!(getBaseNode().getReferredIdentity() instanceof YangJavaIdentity)) { | 130 | + if (!(getBaseNode().getReferredIdentity() instanceof YangJavaIdentityTranslator)) { |
135 | throw new TranslatorException("Failed to prepare generate code entry for base node"); | 131 | throw new TranslatorException("Failed to prepare generate code entry for base node"); |
136 | } | 132 | } |
137 | - YangJavaIdentity baseIdentity = (YangJavaIdentity) getBaseNode().getReferredIdentity(); | 133 | + YangJavaIdentityTranslator baseIdentity = (YangJavaIdentityTranslator) getBaseNode() |
134 | + .getReferredIdentity(); | ||
138 | String baseClassName = getCapitalCase(baseIdentity.getJavaFileInfo().getJavaName()); | 135 | String baseClassName = getCapitalCase(baseIdentity.getJavaFileInfo().getJavaName()); |
139 | String basePkg = baseIdentity.getJavaFileInfo().getPackage(); | 136 | String basePkg = baseIdentity.getJavaFileInfo().getPackage(); |
140 | basePkgInfo.setClassInfo(baseClassName); | 137 | basePkgInfo.setClassInfo(baseClassName); | ... | ... |
... | @@ -18,13 +18,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; | ... | @@ -18,13 +18,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; |
18 | 18 | ||
19 | import java.io.IOException; | 19 | import java.io.IOException; |
20 | 20 | ||
21 | -import org.onosproject.yangutils.datamodel.YangInput; | 21 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
22 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaInput; | ||
23 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
22 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 24 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
23 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 25 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
24 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 26 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
25 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
26 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 27 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
27 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
28 | 28 | ||
29 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; | 29 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; |
30 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfAugmentableNode; | 30 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfAugmentableNode; |
... | @@ -32,18 +32,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen | ... | @@ -32,18 +32,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen |
32 | /** | 32 | /** |
33 | * Represents input information extended to support java code generation. | 33 | * Represents input information extended to support java code generation. |
34 | */ | 34 | */ |
35 | -public class YangJavaInput | 35 | +public class YangJavaInputTranslator |
36 | - extends YangInput | 36 | + extends YangJavaInput |
37 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { | 37 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { |
38 | 38 | ||
39 | private static final long serialVersionUID = 806201627L; | 39 | private static final long serialVersionUID = 806201627L; |
40 | 40 | ||
41 | /** | 41 | /** |
42 | - * Contains information of the java file being generated. | ||
43 | - */ | ||
44 | - private JavaFileInfo javaFileInfo; | ||
45 | - | ||
46 | - /** | ||
47 | * File handle to maintain temporary java code fragments as per the code | 42 | * File handle to maintain temporary java code fragments as per the code |
48 | * snippet types. | 43 | * snippet types. |
49 | */ | 44 | */ |
... | @@ -52,7 +47,7 @@ public class YangJavaInput | ... | @@ -52,7 +47,7 @@ public class YangJavaInput |
52 | /** | 47 | /** |
53 | * Creates an instance of java input. | 48 | * Creates an instance of java input. |
54 | */ | 49 | */ |
55 | - public YangJavaInput() { | 50 | + public YangJavaInputTranslator() { |
56 | super(); | 51 | super(); |
57 | setJavaFileInfo(new JavaFileInfo()); | 52 | setJavaFileInfo(new JavaFileInfo()); |
58 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); | 53 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); | ... | ... |
... | @@ -15,31 +15,30 @@ | ... | @@ -15,31 +15,30 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.yangutils.translator.tojava.javamodel; | 16 | package org.onosproject.yangutils.translator.tojava.javamodel; |
17 | 17 | ||
18 | -import org.onosproject.yangutils.datamodel.YangLeafList; | 18 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaLeafList; |
19 | -import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; | 19 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangToJavaNamingConflictUtil; |
20 | -import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil; | 20 | +import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator; |
21 | 21 | ||
22 | -import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.updateLeavesJavaQualifiedInfo; | 22 | +import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator.updateLeavesJavaQualifiedInfo; |
23 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCamelCase; | 23 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCamelCase; |
24 | 24 | ||
25 | /** | 25 | /** |
26 | * Represents java information corresponding to the YANG leaf-list. | 26 | * Represents java information corresponding to the YANG leaf-list. |
27 | */ | 27 | */ |
28 | -public class YangJavaLeafList | 28 | +public class YangJavaLeafListTranslator |
29 | - extends YangLeafList | 29 | + extends YangJavaLeafList |
30 | implements JavaLeafInfoContainer { | 30 | implements JavaLeafInfoContainer { |
31 | 31 | ||
32 | private static final long serialVersionUID = 806201638L; | 32 | private static final long serialVersionUID = 806201638L; |
33 | 33 | ||
34 | - private JavaQualifiedTypeInfo javaQualifiedAccess; | ||
35 | private transient YangToJavaNamingConflictUtil conflictResolveConfig; | 34 | private transient YangToJavaNamingConflictUtil conflictResolveConfig; |
36 | 35 | ||
37 | /** | 36 | /** |
38 | * Returns a new YANG leaf object with java qualified access details. | 37 | * Returns a new YANG leaf object with java qualified access details. |
39 | */ | 38 | */ |
40 | - public YangJavaLeafList() { | 39 | + public YangJavaLeafListTranslator() { |
41 | super(); | 40 | super(); |
42 | - setJavaQualifiedInfo(new JavaQualifiedTypeInfo()); | 41 | + setJavaQualifiedInfo(new JavaQualifiedTypeInfoTranslator()); |
43 | } | 42 | } |
44 | 43 | ||
45 | @Override | 44 | @Override |
... | @@ -58,13 +57,13 @@ public class YangJavaLeafList | ... | @@ -58,13 +57,13 @@ public class YangJavaLeafList |
58 | } | 57 | } |
59 | 58 | ||
60 | @Override | 59 | @Override |
61 | - public JavaQualifiedTypeInfo getJavaQualifiedInfo() { | 60 | + public JavaQualifiedTypeInfoTranslator getJavaQualifiedInfo() { |
62 | - return javaQualifiedAccess; | 61 | + return (JavaQualifiedTypeInfoTranslator) javaQualifiedTypeInfo; |
63 | } | 62 | } |
64 | 63 | ||
65 | @Override | 64 | @Override |
66 | - public void setJavaQualifiedInfo(JavaQualifiedTypeInfo typeInfo) { | 65 | + public void setJavaQualifiedInfo(JavaQualifiedTypeInfoTranslator typeInfo) { |
67 | - javaQualifiedAccess = typeInfo; | 66 | + javaQualifiedTypeInfo = typeInfo; |
68 | } | 67 | } |
69 | 68 | ||
70 | /** | 69 | /** | ... | ... |
... | @@ -15,41 +15,40 @@ | ... | @@ -15,41 +15,40 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.yangutils.translator.tojava.javamodel; | 16 | package org.onosproject.yangutils.translator.tojava.javamodel; |
17 | 17 | ||
18 | -import org.onosproject.yangutils.datamodel.YangLeaf; | 18 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaLeaf; |
19 | -import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; | 19 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangToJavaNamingConflictUtil; |
20 | -import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil; | 20 | +import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator; |
21 | 21 | ||
22 | -import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.updateLeavesJavaQualifiedInfo; | 22 | +import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator.updateLeavesJavaQualifiedInfo; |
23 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCamelCase; | 23 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCamelCase; |
24 | 24 | ||
25 | /** | 25 | /** |
26 | * Represents java information corresponding to the YANG leaf. | 26 | * Represents java information corresponding to the YANG leaf. |
27 | */ | 27 | */ |
28 | -public class YangJavaLeaf | 28 | +public class YangJavaLeafTranslator |
29 | - extends YangLeaf | 29 | + extends YangJavaLeaf |
30 | implements JavaLeafInfoContainer { | 30 | implements JavaLeafInfoContainer { |
31 | 31 | ||
32 | private static final long serialVersionUID = 806201636L; | 32 | private static final long serialVersionUID = 806201636L; |
33 | 33 | ||
34 | - private JavaQualifiedTypeInfo javaQualifiedAccess; | ||
35 | private transient YangToJavaNamingConflictUtil conflictResolveConfig; | 34 | private transient YangToJavaNamingConflictUtil conflictResolveConfig; |
36 | 35 | ||
37 | /** | 36 | /** |
38 | * Returns a new YANG leaf object with java qualified access details. | 37 | * Returns a new YANG leaf object with java qualified access details. |
39 | */ | 38 | */ |
40 | - public YangJavaLeaf() { | 39 | + public YangJavaLeafTranslator() { |
41 | super(); | 40 | super(); |
42 | - setJavaQualifiedInfo(new JavaQualifiedTypeInfo()); | 41 | + setJavaQualifiedInfo(new JavaQualifiedTypeInfoTranslator()); |
43 | } | 42 | } |
44 | 43 | ||
45 | @Override | 44 | @Override |
46 | - public JavaQualifiedTypeInfo getJavaQualifiedInfo() { | 45 | + public JavaQualifiedTypeInfoTranslator getJavaQualifiedInfo() { |
47 | - return javaQualifiedAccess; | 46 | + return (JavaQualifiedTypeInfoTranslator) javaQualifiedTypeInfo; |
48 | } | 47 | } |
49 | 48 | ||
50 | @Override | 49 | @Override |
51 | - public void setJavaQualifiedInfo(JavaQualifiedTypeInfo typeInfo) { | 50 | + public void setJavaQualifiedInfo(JavaQualifiedTypeInfoTranslator typeInfo) { |
52 | - javaQualifiedAccess = typeInfo; | 51 | + javaQualifiedTypeInfo = typeInfo; |
53 | 52 | ||
54 | } | 53 | } |
55 | 54 | ... | ... |
... | @@ -17,13 +17,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; | ... | @@ -17,13 +17,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; |
17 | 17 | ||
18 | import java.io.IOException; | 18 | import java.io.IOException; |
19 | 19 | ||
20 | -import org.onosproject.yangutils.datamodel.YangList; | 20 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
21 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaList; | ||
22 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
21 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 23 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
22 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 24 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
23 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 25 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
24 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
25 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 26 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
26 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
27 | 27 | ||
28 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; | 28 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; |
29 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeAndUpdateInParent; | 29 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeAndUpdateInParent; |
... | @@ -31,18 +31,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen | ... | @@ -31,18 +31,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen |
31 | /** | 31 | /** |
32 | * Represents YANG list information extended to support java code generation. | 32 | * Represents YANG list information extended to support java code generation. |
33 | */ | 33 | */ |
34 | -public class YangJavaList | 34 | +public class YangJavaListTranslator |
35 | - extends YangList | 35 | + extends YangJavaList |
36 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { | 36 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { |
37 | 37 | ||
38 | private static final long serialVersionUID = 806201626L; | 38 | private static final long serialVersionUID = 806201626L; |
39 | 39 | ||
40 | /** | 40 | /** |
41 | - * Contains the information of the java file being generated. | ||
42 | - */ | ||
43 | - private JavaFileInfo javaFileInfo; | ||
44 | - | ||
45 | - /** | ||
46 | * File handle to maintain temporary java code fragments as per the code | 41 | * File handle to maintain temporary java code fragments as per the code |
47 | * snippet types. | 42 | * snippet types. |
48 | */ | 43 | */ |
... | @@ -51,7 +46,7 @@ public class YangJavaList | ... | @@ -51,7 +46,7 @@ public class YangJavaList |
51 | /** | 46 | /** |
52 | * Creates YANG java list object. | 47 | * Creates YANG java list object. |
53 | */ | 48 | */ |
54 | - public YangJavaList() { | 49 | + public YangJavaListTranslator() { |
55 | super(); | 50 | super(); |
56 | setJavaFileInfo(new JavaFileInfo()); | 51 | setJavaFileInfo(new JavaFileInfo()); |
57 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); | 52 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); | ... | ... |
... | @@ -19,15 +19,15 @@ import java.io.IOException; | ... | @@ -19,15 +19,15 @@ import java.io.IOException; |
19 | import java.util.ArrayList; | 19 | import java.util.ArrayList; |
20 | import java.util.List; | 20 | import java.util.List; |
21 | 21 | ||
22 | -import org.onosproject.yangutils.datamodel.YangModule; | ||
23 | import org.onosproject.yangutils.datamodel.YangNode; | 22 | import org.onosproject.yangutils.datamodel.YangNode; |
24 | import org.onosproject.yangutils.datamodel.YangNotification; | 23 | import org.onosproject.yangutils.datamodel.YangNotification; |
24 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; | ||
25 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaModule; | ||
26 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
25 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 27 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
26 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 28 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
27 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 29 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
28 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
29 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 30 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
30 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
31 | 31 | ||
32 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ALL_EVENT_CLASS_MASK; | 32 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ALL_EVENT_CLASS_MASK; |
33 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; | 33 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; |
... | @@ -42,18 +42,13 @@ import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.searchAndDelet | ... | @@ -42,18 +42,13 @@ import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.searchAndDelet |
42 | /** | 42 | /** |
43 | * Represents module information extended to support java code generation. | 43 | * Represents module information extended to support java code generation. |
44 | */ | 44 | */ |
45 | -public class YangJavaModule | 45 | +public class YangJavaModuleTranslator |
46 | - extends YangModule | 46 | + extends YangJavaModule |
47 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { | 47 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { |
48 | 48 | ||
49 | private static final long serialVersionUID = 806201625L; | 49 | private static final long serialVersionUID = 806201625L; |
50 | 50 | ||
51 | /** | 51 | /** |
52 | - * Contains the information of the java file being generated. | ||
53 | - */ | ||
54 | - private JavaFileInfo javaFileInfo; | ||
55 | - | ||
56 | - /** | ||
57 | * File handle to maintain temporary java code fragments as per the code snippet types. | 52 | * File handle to maintain temporary java code fragments as per the code snippet types. |
58 | */ | 53 | */ |
59 | private transient TempJavaCodeFragmentFiles tempFileHandle; | 54 | private transient TempJavaCodeFragmentFiles tempFileHandle; |
... | @@ -66,7 +61,7 @@ public class YangJavaModule | ... | @@ -66,7 +61,7 @@ public class YangJavaModule |
66 | /** | 61 | /** |
67 | * Creates a YANG node of module type. | 62 | * Creates a YANG node of module type. |
68 | */ | 63 | */ |
69 | - public YangJavaModule() { | 64 | + public YangJavaModuleTranslator() { |
70 | super(); | 65 | super(); |
71 | setJavaFileInfo(new JavaFileInfo()); | 66 | setJavaFileInfo(new JavaFileInfo()); |
72 | setNotificationNodes(new ArrayList<>()); | 67 | setNotificationNodes(new ArrayList<>()); | ... | ... |
... | @@ -19,40 +19,35 @@ package org.onosproject.yangutils.translator.tojava.javamodel; | ... | @@ -19,40 +19,35 @@ package org.onosproject.yangutils.translator.tojava.javamodel; |
19 | import java.io.IOException; | 19 | import java.io.IOException; |
20 | 20 | ||
21 | import org.onosproject.yangutils.datamodel.YangNode; | 21 | import org.onosproject.yangutils.datamodel.YangNode; |
22 | -import org.onosproject.yangutils.datamodel.YangNotification; | 22 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
23 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaNotification; | ||
24 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
23 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 25 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
24 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 26 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
25 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 27 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
26 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
27 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; | 28 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; |
28 | -import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; | 29 | +import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator; |
29 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 30 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
30 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer; | 31 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer; |
31 | import org.onosproject.yangutils.translator.tojava.TempJavaServiceFragmentFiles; | 32 | import org.onosproject.yangutils.translator.tojava.TempJavaServiceFragmentFiles; |
32 | import org.onosproject.yangutils.translator.tojava.utils.JavaExtendsListHolder; | 33 | import org.onosproject.yangutils.translator.tojava.utils.JavaExtendsListHolder; |
33 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
34 | 34 | ||
35 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; | 35 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; |
36 | -import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase; | ||
37 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfAugmentableNode; | 36 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfAugmentableNode; |
38 | import static org.onosproject.yangutils.utils.UtilConstants.EVENT_LISTENER_STRING; | 37 | import static org.onosproject.yangutils.utils.UtilConstants.EVENT_LISTENER_STRING; |
39 | import static org.onosproject.yangutils.utils.UtilConstants.EVENT_STRING; | 38 | import static org.onosproject.yangutils.utils.UtilConstants.EVENT_STRING; |
39 | +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase; | ||
40 | 40 | ||
41 | /** | 41 | /** |
42 | * Represents notification information extended to support java code generation. | 42 | * Represents notification information extended to support java code generation. |
43 | */ | 43 | */ |
44 | -public class YangJavaNotification | 44 | +public class YangJavaNotificationTranslator |
45 | - extends YangNotification | 45 | + extends YangJavaNotification |
46 | implements JavaCodeGenerator, JavaCodeGeneratorInfo { | 46 | implements JavaCodeGenerator, JavaCodeGeneratorInfo { |
47 | 47 | ||
48 | private static final long serialVersionUID = 806201624L; | 48 | private static final long serialVersionUID = 806201624L; |
49 | 49 | ||
50 | /** | 50 | /** |
51 | - * Contains information of the java file being generated. | ||
52 | - */ | ||
53 | - private JavaFileInfo javaFileInfo; | ||
54 | - | ||
55 | - /** | ||
56 | * File handle to maintain temporary java code fragments as per the code | 51 | * File handle to maintain temporary java code fragments as per the code |
57 | * snippet types. | 52 | * snippet types. |
58 | */ | 53 | */ |
... | @@ -61,7 +56,7 @@ public class YangJavaNotification | ... | @@ -61,7 +56,7 @@ public class YangJavaNotification |
61 | /** | 56 | /** |
62 | * Creates an instance of java Notification. | 57 | * Creates an instance of java Notification. |
63 | */ | 58 | */ |
64 | - public YangJavaNotification() { | 59 | + public YangJavaNotificationTranslator() { |
65 | super(); | 60 | super(); |
66 | setJavaFileInfo(new JavaFileInfo()); | 61 | setJavaFileInfo(new JavaFileInfo()); |
67 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); | 62 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); |
... | @@ -148,7 +143,7 @@ public class YangJavaNotification | ... | @@ -148,7 +143,7 @@ public class YangJavaNotification |
148 | .getTempJavaCodeFragmentFiles() | 143 | .getTempJavaCodeFragmentFiles() |
149 | .getServiceTempFiles(); | 144 | .getServiceTempFiles(); |
150 | JavaExtendsListHolder holder = tempJavaServiceFragmentFiles.getJavaExtendsListHolder(); | 145 | JavaExtendsListHolder holder = tempJavaServiceFragmentFiles.getJavaExtendsListHolder(); |
151 | - JavaQualifiedTypeInfo event = new JavaQualifiedTypeInfo(); | 146 | + JavaQualifiedTypeInfoTranslator event = new JavaQualifiedTypeInfoTranslator(); |
152 | 147 | ||
153 | String parentInfo = getCapitalCase(((JavaFileInfoContainer) parent) | 148 | String parentInfo = getCapitalCase(((JavaFileInfoContainer) parent) |
154 | .getJavaFileInfo().getJavaName()); | 149 | .getJavaFileInfo().getJavaName()); |
... | @@ -156,7 +151,7 @@ public class YangJavaNotification | ... | @@ -156,7 +151,7 @@ public class YangJavaNotification |
156 | event.setPkgInfo(getJavaFileInfo().getPackage()); | 151 | event.setPkgInfo(getJavaFileInfo().getPackage()); |
157 | holder.addToExtendsList(event, parent, tempJavaServiceFragmentFiles); | 152 | holder.addToExtendsList(event, parent, tempJavaServiceFragmentFiles); |
158 | 153 | ||
159 | - JavaQualifiedTypeInfo eventListener = new JavaQualifiedTypeInfo(); | 154 | + JavaQualifiedTypeInfoTranslator eventListener = new JavaQualifiedTypeInfoTranslator(); |
160 | 155 | ||
161 | eventListener.setClassInfo(parentInfo + EVENT_LISTENER_STRING); | 156 | eventListener.setClassInfo(parentInfo + EVENT_LISTENER_STRING); |
162 | eventListener.setPkgInfo(getJavaFileInfo().getPackage()); | 157 | eventListener.setPkgInfo(getJavaFileInfo().getPackage()); | ... | ... |
... | @@ -18,13 +18,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; | ... | @@ -18,13 +18,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; |
18 | 18 | ||
19 | import java.io.IOException; | 19 | import java.io.IOException; |
20 | 20 | ||
21 | -import org.onosproject.yangutils.datamodel.YangOutput; | 21 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
22 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaOutput; | ||
23 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
22 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 24 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
23 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 25 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
24 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 26 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
25 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
26 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 27 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
27 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
28 | 28 | ||
29 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; | 29 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; |
30 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfAugmentableNode; | 30 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfAugmentableNode; |
... | @@ -32,18 +32,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen | ... | @@ -32,18 +32,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen |
32 | /** | 32 | /** |
33 | * Represents output information extended to support java code generation. | 33 | * Represents output information extended to support java code generation. |
34 | */ | 34 | */ |
35 | -public class YangJavaOutput | 35 | +public class YangJavaOutputTranslator |
36 | - extends YangOutput | 36 | + extends YangJavaOutput |
37 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { | 37 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { |
38 | 38 | ||
39 | private static final long serialVersionUID = 806201623L; | 39 | private static final long serialVersionUID = 806201623L; |
40 | 40 | ||
41 | /** | 41 | /** |
42 | - * Contains information of the java file being generated. | ||
43 | - */ | ||
44 | - private JavaFileInfo javaFileInfo; | ||
45 | - | ||
46 | - /** | ||
47 | * File handle to maintain temporary java code fragments as per the code | 42 | * File handle to maintain temporary java code fragments as per the code |
48 | * snippet types. | 43 | * snippet types. |
49 | */ | 44 | */ |
... | @@ -52,7 +47,7 @@ public class YangJavaOutput | ... | @@ -52,7 +47,7 @@ public class YangJavaOutput |
52 | /** | 47 | /** |
53 | * Creates an instance of java output. | 48 | * Creates an instance of java output. |
54 | */ | 49 | */ |
55 | - public YangJavaOutput() { | 50 | + public YangJavaOutputTranslator() { |
56 | super(); | 51 | super(); |
57 | setJavaFileInfo(new JavaFileInfo()); | 52 | setJavaFileInfo(new JavaFileInfo()); |
58 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); | 53 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER); | ... | ... |
... | @@ -22,23 +22,22 @@ import org.onosproject.yangutils.datamodel.RpcNotificationContainer; | ... | @@ -22,23 +22,22 @@ import org.onosproject.yangutils.datamodel.RpcNotificationContainer; |
22 | import org.onosproject.yangutils.datamodel.YangInput; | 22 | import org.onosproject.yangutils.datamodel.YangInput; |
23 | import org.onosproject.yangutils.datamodel.YangNode; | 23 | import org.onosproject.yangutils.datamodel.YangNode; |
24 | import org.onosproject.yangutils.datamodel.YangOutput; | 24 | import org.onosproject.yangutils.datamodel.YangOutput; |
25 | -import org.onosproject.yangutils.datamodel.YangRpc; | 25 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
26 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaRpc; | ||
27 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
26 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 28 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
27 | import org.onosproject.yangutils.translator.tojava.JavaAttributeInfo; | 29 | import org.onosproject.yangutils.translator.tojava.JavaAttributeInfo; |
28 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 30 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
29 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 31 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
30 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
31 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; | 32 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; |
32 | -import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; | 33 | +import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator; |
33 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 34 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
34 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer; | 35 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer; |
35 | import org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles; | 36 | import org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles; |
36 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
37 | 37 | ||
38 | import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.getParentNodeInGenCode; | 38 | import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.getParentNodeInGenCode; |
39 | import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; | 39 | import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; |
40 | -import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfCurNode; | 40 | +import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator.getQualifiedTypeInfoOfCurNode; |
41 | -import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase; | ||
42 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.updatePackageInfo; | 41 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.updatePackageInfo; |
43 | import static org.onosproject.yangutils.utils.UtilConstants.ACTIVATE; | 42 | import static org.onosproject.yangutils.utils.UtilConstants.ACTIVATE; |
44 | import static org.onosproject.yangutils.utils.UtilConstants.COMPONENT; | 43 | import static org.onosproject.yangutils.utils.UtilConstants.COMPONENT; |
... | @@ -47,22 +46,18 @@ import static org.onosproject.yangutils.utils.UtilConstants.MANAGER; | ... | @@ -47,22 +46,18 @@ import static org.onosproject.yangutils.utils.UtilConstants.MANAGER; |
47 | import static org.onosproject.yangutils.utils.UtilConstants.REFERENCE; | 46 | import static org.onosproject.yangutils.utils.UtilConstants.REFERENCE; |
48 | import static org.onosproject.yangutils.utils.UtilConstants.REFERENCE_CARDINALITY; | 47 | import static org.onosproject.yangutils.utils.UtilConstants.REFERENCE_CARDINALITY; |
49 | import static org.onosproject.yangutils.utils.UtilConstants.SERVICE; | 48 | import static org.onosproject.yangutils.utils.UtilConstants.SERVICE; |
49 | +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase; | ||
50 | 50 | ||
51 | /** | 51 | /** |
52 | * Represents rpc information extended to support java code generation. | 52 | * Represents rpc information extended to support java code generation. |
53 | */ | 53 | */ |
54 | -public class YangJavaRpc | 54 | +public class YangJavaRpcTranslator |
55 | - extends YangRpc | 55 | + extends YangJavaRpc |
56 | implements JavaCodeGenerator, JavaCodeGeneratorInfo { | 56 | implements JavaCodeGenerator, JavaCodeGeneratorInfo { |
57 | 57 | ||
58 | private static final long serialVersionUID = 806201622L; | 58 | private static final long serialVersionUID = 806201622L; |
59 | 59 | ||
60 | /** | 60 | /** |
61 | - * Contains the information of the java file being generated. | ||
62 | - */ | ||
63 | - private JavaFileInfo javaFileInfo; | ||
64 | - | ||
65 | - /** | ||
66 | * Temproary file for code generation. | 61 | * Temproary file for code generation. |
67 | */ | 62 | */ |
68 | private transient TempJavaCodeFragmentFiles tempJavaCodeFragmentFiles; | 63 | private transient TempJavaCodeFragmentFiles tempJavaCodeFragmentFiles; |
... | @@ -70,7 +65,7 @@ public class YangJavaRpc | ... | @@ -70,7 +65,7 @@ public class YangJavaRpc |
70 | /** | 65 | /** |
71 | * Creates an instance of YANG java rpc. | 66 | * Creates an instance of YANG java rpc. |
72 | */ | 67 | */ |
73 | - public YangJavaRpc() { | 68 | + public YangJavaRpcTranslator() { |
74 | super(); | 69 | super(); |
75 | setJavaFileInfo(new JavaFileInfo()); | 70 | setJavaFileInfo(new JavaFileInfo()); |
76 | } | 71 | } |
... | @@ -206,7 +201,7 @@ public class YangJavaRpc | ... | @@ -206,7 +201,7 @@ public class YangJavaRpc |
206 | * Get the import info corresponding to the attribute for import in | 201 | * Get the import info corresponding to the attribute for import in |
207 | * generated java files or qualified access | 202 | * generated java files or qualified access |
208 | */ | 203 | */ |
209 | - JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(childNode, | 204 | + JavaQualifiedTypeInfoTranslator qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(childNode, |
210 | getCapitalCase(childNodeName)); | 205 | getCapitalCase(childNodeName)); |
211 | if (!(parentNode instanceof TempJavaCodeFragmentFilesContainer)) { | 206 | if (!(parentNode instanceof TempJavaCodeFragmentFilesContainer)) { |
212 | throw new TranslatorException("Parent node does not have file info"); | 207 | throw new TranslatorException("Parent node does not have file info"); |
... | @@ -230,7 +225,7 @@ public class YangJavaRpc | ... | @@ -230,7 +225,7 @@ public class YangJavaRpc |
230 | * @param importInfo import info | 225 | * @param importInfo import info |
231 | * @return true or false | 226 | * @return true or false |
232 | */ | 227 | */ |
233 | - private boolean addImportToService(JavaQualifiedTypeInfo importInfo) { | 228 | + private boolean addImportToService(JavaQualifiedTypeInfoTranslator importInfo) { |
234 | JavaFileInfo fileInfo = ((JavaFileInfoContainer) getParent()).getJavaFileInfo(); | 229 | JavaFileInfo fileInfo = ((JavaFileInfoContainer) getParent()).getJavaFileInfo(); |
235 | 230 | ||
236 | if (importInfo.getClassInfo().contentEquals(SERVICE) | 231 | if (importInfo.getClassInfo().contentEquals(SERVICE) | ... | ... |
... | @@ -23,13 +23,13 @@ import org.onosproject.yangutils.datamodel.YangBelongsTo; | ... | @@ -23,13 +23,13 @@ import org.onosproject.yangutils.datamodel.YangBelongsTo; |
23 | import org.onosproject.yangutils.datamodel.YangModule; | 23 | import org.onosproject.yangutils.datamodel.YangModule; |
24 | import org.onosproject.yangutils.datamodel.YangNode; | 24 | import org.onosproject.yangutils.datamodel.YangNode; |
25 | import org.onosproject.yangutils.datamodel.YangNotification; | 25 | import org.onosproject.yangutils.datamodel.YangNotification; |
26 | -import org.onosproject.yangutils.datamodel.YangSubModule; | 26 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
27 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaSubModule; | ||
28 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
27 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 29 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
28 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 30 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
29 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 31 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
30 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
31 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 32 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
32 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
33 | 33 | ||
34 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ALL_EVENT_CLASS_MASK; | 34 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ALL_EVENT_CLASS_MASK; |
35 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; | 35 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; |
... | @@ -44,18 +44,13 @@ import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.searchAndDelet | ... | @@ -44,18 +44,13 @@ import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.searchAndDelet |
44 | /** | 44 | /** |
45 | * Represents sub module information extended to support java code generation. | 45 | * Represents sub module information extended to support java code generation. |
46 | */ | 46 | */ |
47 | -public class YangJavaSubModule | 47 | +public class YangJavaSubModuleTranslator |
48 | - extends YangSubModule | 48 | + extends YangJavaSubModule |
49 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { | 49 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { |
50 | 50 | ||
51 | private static final long serialVersionUID = 806201621L; | 51 | private static final long serialVersionUID = 806201621L; |
52 | 52 | ||
53 | /** | 53 | /** |
54 | - * Contains the information of the java file being generated. | ||
55 | - */ | ||
56 | - private JavaFileInfo javaFileInfo; | ||
57 | - | ||
58 | - /** | ||
59 | * File handle to maintain temporary java code fragments as per the code snippet types. | 54 | * File handle to maintain temporary java code fragments as per the code snippet types. |
60 | */ | 55 | */ |
61 | private transient TempJavaCodeFragmentFiles tempFileHandle; | 56 | private transient TempJavaCodeFragmentFiles tempFileHandle; |
... | @@ -68,7 +63,7 @@ public class YangJavaSubModule | ... | @@ -68,7 +63,7 @@ public class YangJavaSubModule |
68 | /** | 63 | /** |
69 | * Creates YANG java sub module object. | 64 | * Creates YANG java sub module object. |
70 | */ | 65 | */ |
71 | - public YangJavaSubModule() { | 66 | + public YangJavaSubModuleTranslator() { |
72 | super(); | 67 | super(); |
73 | setJavaFileInfo(new JavaFileInfo()); | 68 | setJavaFileInfo(new JavaFileInfo()); |
74 | int gentype = GENERATE_SERVICE_AND_MANAGER | GENERATE_INTERFACE_WITH_BUILDER; | 69 | int gentype = GENERATE_SERVICE_AND_MANAGER | GENERATE_INTERFACE_WITH_BUILDER; | ... | ... |
... | @@ -17,13 +17,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; | ... | @@ -17,13 +17,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; |
17 | 17 | ||
18 | import java.io.IOException; | 18 | import java.io.IOException; |
19 | 19 | ||
20 | -import org.onosproject.yangutils.datamodel.YangTypeDef; | 20 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
21 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaTypeDef; | ||
22 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
21 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 23 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
22 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 24 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
23 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 25 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
24 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
25 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 26 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
26 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
27 | 27 | ||
28 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_TYPEDEF_CLASS; | 28 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_TYPEDEF_CLASS; |
29 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfNode; | 29 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfNode; |
... | @@ -31,18 +31,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen | ... | @@ -31,18 +31,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen |
31 | /** | 31 | /** |
32 | * Represents type define information extended to support java code generation. | 32 | * Represents type define information extended to support java code generation. |
33 | */ | 33 | */ |
34 | -public class YangJavaTypeDef | 34 | +public class YangJavaTypeDefTranslator |
35 | - extends YangTypeDef | 35 | + extends YangJavaTypeDef |
36 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { | 36 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { |
37 | 37 | ||
38 | private static final long serialVersionUID = 806201620L; | 38 | private static final long serialVersionUID = 806201620L; |
39 | 39 | ||
40 | /** | 40 | /** |
41 | - * Contains the information of the java file being generated. | ||
42 | - */ | ||
43 | - private JavaFileInfo javaFileInfo; | ||
44 | - | ||
45 | - /** | ||
46 | * File handle to maintain temporary java code fragments as per the code | 41 | * File handle to maintain temporary java code fragments as per the code |
47 | * snippet types. | 42 | * snippet types. |
48 | */ | 43 | */ |
... | @@ -51,7 +46,7 @@ public class YangJavaTypeDef | ... | @@ -51,7 +46,7 @@ public class YangJavaTypeDef |
51 | /** | 46 | /** |
52 | * Creates a YANG java typedef object. | 47 | * Creates a YANG java typedef object. |
53 | */ | 48 | */ |
54 | - public YangJavaTypeDef() { | 49 | + public YangJavaTypeDefTranslator() { |
55 | super(); | 50 | super(); |
56 | setJavaFileInfo(new JavaFileInfo()); | 51 | setJavaFileInfo(new JavaFileInfo()); |
57 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_TYPEDEF_CLASS); | 52 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_TYPEDEF_CLASS); | ... | ... |
... | @@ -16,16 +16,17 @@ | ... | @@ -16,16 +16,17 @@ |
16 | package org.onosproject.yangutils.translator.tojava.javamodel; | 16 | package org.onosproject.yangutils.translator.tojava.javamodel; |
17 | 17 | ||
18 | import org.onosproject.yangutils.datamodel.YangType; | 18 | import org.onosproject.yangutils.datamodel.YangType; |
19 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaQualifiedTypeInfo; | ||
20 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangToJavaNamingConflictUtil; | ||
19 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 21 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
20 | -import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; | 22 | +import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator; |
21 | -import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil; | ||
22 | 23 | ||
23 | /** | 24 | /** |
24 | * Represents java information corresponding to the YANG type. | 25 | * Represents java information corresponding to the YANG type. |
25 | * | 26 | * |
26 | * @param <T> generic parameter for YANG java type | 27 | * @param <T> generic parameter for YANG java type |
27 | */ | 28 | */ |
28 | -public class YangJavaType<T> | 29 | +public class YangJavaTypeTranslator<T> |
29 | extends YangType<T> | 30 | extends YangType<T> |
30 | implements JavaQualifiedTypeResolver { | 31 | implements JavaQualifiedTypeResolver { |
31 | 32 | ||
... | @@ -34,14 +35,14 @@ public class YangJavaType<T> | ... | @@ -34,14 +35,14 @@ public class YangJavaType<T> |
34 | /** | 35 | /** |
35 | * Create a YANG leaf object with java qualified access details. | 36 | * Create a YANG leaf object with java qualified access details. |
36 | */ | 37 | */ |
37 | - public YangJavaType() { | 38 | + public YangJavaTypeTranslator() { |
38 | super(); | 39 | super(); |
39 | - setJavaQualifiedInfo(new JavaQualifiedTypeInfo()); | 40 | + setJavaQualifiedInfo(new JavaQualifiedTypeInfoTranslator()); |
40 | } | 41 | } |
41 | 42 | ||
42 | @Override | 43 | @Override |
43 | public void updateJavaQualifiedInfo(YangToJavaNamingConflictUtil conflictResolver) { | 44 | public void updateJavaQualifiedInfo(YangToJavaNamingConflictUtil conflictResolver) { |
44 | - JavaQualifiedTypeInfo importInfo = getJavaQualifiedInfo(); | 45 | + JavaQualifiedTypeInfoTranslator importInfo = getJavaQualifiedInfo(); |
45 | 46 | ||
46 | /* | 47 | /* |
47 | * Type is added as an attribute in the class. | 48 | * Type is added as an attribute in the class. |
... | @@ -74,12 +75,12 @@ public class YangJavaType<T> | ... | @@ -74,12 +75,12 @@ public class YangJavaType<T> |
74 | } | 75 | } |
75 | 76 | ||
76 | @Override | 77 | @Override |
77 | - public JavaQualifiedTypeInfo getJavaQualifiedInfo() { | 78 | + public JavaQualifiedTypeInfoTranslator getJavaQualifiedInfo() { |
78 | - return javaQualifiedAccess; | 79 | + return (JavaQualifiedTypeInfoTranslator) javaQualifiedAccess; |
79 | } | 80 | } |
80 | 81 | ||
81 | @Override | 82 | @Override |
82 | - public void setJavaQualifiedInfo(JavaQualifiedTypeInfo typeInfo) { | 83 | + public void setJavaQualifiedInfo(JavaQualifiedTypeInfoTranslator typeInfo) { |
83 | javaQualifiedAccess = typeInfo; | 84 | javaQualifiedAccess = typeInfo; |
84 | } | 85 | } |
85 | } | 86 | } | ... | ... |
... | @@ -17,13 +17,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; | ... | @@ -17,13 +17,13 @@ package org.onosproject.yangutils.translator.tojava.javamodel; |
17 | 17 | ||
18 | import java.io.IOException; | 18 | import java.io.IOException; |
19 | 19 | ||
20 | -import org.onosproject.yangutils.datamodel.YangUnion; | 20 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
21 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaUnion; | ||
22 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
21 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 23 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
22 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 24 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
23 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 25 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
24 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
25 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 26 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
26 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
27 | 27 | ||
28 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_UNION_CLASS; | 28 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_UNION_CLASS; |
29 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfNode; | 29 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.generateCodeOfNode; |
... | @@ -31,18 +31,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen | ... | @@ -31,18 +31,13 @@ import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.gen |
31 | /** | 31 | /** |
32 | * Represents union information extended to support java code generation. | 32 | * Represents union information extended to support java code generation. |
33 | */ | 33 | */ |
34 | -public class YangJavaUnion | 34 | +public class YangJavaUnionTranslator |
35 | - extends YangUnion | 35 | + extends YangJavaUnion |
36 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { | 36 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { |
37 | 37 | ||
38 | private static final long serialVersionUID = 806201619L; | 38 | private static final long serialVersionUID = 806201619L; |
39 | 39 | ||
40 | /** | 40 | /** |
41 | - * Contains the information of the java file being generated. | ||
42 | - */ | ||
43 | - private JavaFileInfo javaFileInfo; | ||
44 | - | ||
45 | - /** | ||
46 | * File handle to maintain temporary java code fragments as per the code | 41 | * File handle to maintain temporary java code fragments as per the code |
47 | * snippet types. | 42 | * snippet types. |
48 | */ | 43 | */ |
... | @@ -51,7 +46,7 @@ public class YangJavaUnion | ... | @@ -51,7 +46,7 @@ public class YangJavaUnion |
51 | /** | 46 | /** |
52 | * Creates an instance of YANG java union. | 47 | * Creates an instance of YANG java union. |
53 | */ | 48 | */ |
54 | - public YangJavaUnion() { | 49 | + public YangJavaUnionTranslator() { |
55 | super(); | 50 | super(); |
56 | setJavaFileInfo(new JavaFileInfo()); | 51 | setJavaFileInfo(new JavaFileInfo()); |
57 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_UNION_CLASS); | 52 | getJavaFileInfo().setGeneratedFileTypes(GENERATE_UNION_CLASS); | ... | ... |
... | @@ -15,30 +15,25 @@ | ... | @@ -15,30 +15,25 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.yangutils.translator.tojava.javamodel; | 16 | package org.onosproject.yangutils.translator.tojava.javamodel; |
17 | 17 | ||
18 | -import org.onosproject.yangutils.datamodel.YangUses; | 18 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
19 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaUses; | ||
20 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
19 | import org.onosproject.yangutils.translator.exception.InvalidNodeForTranslatorException; | 21 | import org.onosproject.yangutils.translator.exception.InvalidNodeForTranslatorException; |
20 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 22 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
21 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; | 23 | import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; |
22 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 24 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
23 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
24 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 25 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
25 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
26 | 26 | ||
27 | /** | 27 | /** |
28 | * Represents uses information extended to support java code generation. | 28 | * Represents uses information extended to support java code generation. |
29 | */ | 29 | */ |
30 | -public class YangJavaUses | 30 | +public class YangJavaUsesTranslator |
31 | - extends YangUses | 31 | + extends YangJavaUses |
32 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { | 32 | implements JavaCodeGeneratorInfo, JavaCodeGenerator { |
33 | 33 | ||
34 | private static final long serialVersionUID = 806201618L; | 34 | private static final long serialVersionUID = 806201618L; |
35 | 35 | ||
36 | /** | 36 | /** |
37 | - * Contains the information of the java file being generated. | ||
38 | - */ | ||
39 | - private JavaFileInfo javaFileInfo; | ||
40 | - | ||
41 | - /** | ||
42 | * File handle to maintain temporary java code fragments as per the code | 37 | * File handle to maintain temporary java code fragments as per the code |
43 | * snippet types. | 38 | * snippet types. |
44 | */ | 39 | */ |
... | @@ -47,7 +42,7 @@ public class YangJavaUses | ... | @@ -47,7 +42,7 @@ public class YangJavaUses |
47 | /** | 42 | /** |
48 | * Creates YANG java uses object. | 43 | * Creates YANG java uses object. |
49 | */ | 44 | */ |
50 | - public YangJavaUses() { | 45 | + public YangJavaUsesTranslator() { |
51 | super(); | 46 | super(); |
52 | setJavaFileInfo(new JavaFileInfo()); | 47 | setJavaFileInfo(new JavaFileInfo()); |
53 | } | 48 | } | ... | ... |
... | @@ -22,9 +22,9 @@ import org.onosproject.yangutils.datamodel.YangIdentity; | ... | @@ -22,9 +22,9 @@ import org.onosproject.yangutils.datamodel.YangIdentity; |
22 | import org.onosproject.yangutils.datamodel.YangNode; | 22 | import org.onosproject.yangutils.datamodel.YangNode; |
23 | import org.onosproject.yangutils.datamodel.YangNotification; | 23 | import org.onosproject.yangutils.datamodel.YangNotification; |
24 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 24 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
25 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | 25 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
26 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; | 26 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; |
27 | -import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; | 27 | +import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator; |
28 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer; | 28 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer; |
29 | 29 | ||
30 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK; | 30 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK; |
... | @@ -445,7 +445,7 @@ public final class ClassDefinitionGenerator { | ... | @@ -445,7 +445,7 @@ public final class ClassDefinitionGenerator { |
445 | * @return updated class definition | 445 | * @return updated class definition |
446 | */ | 446 | */ |
447 | private static String getDefinitionString(String def, JavaExtendsListHolder holder) { | 447 | private static String getDefinitionString(String def, JavaExtendsListHolder holder) { |
448 | - for (JavaQualifiedTypeInfo info : holder.getExtendsList()) { | 448 | + for (JavaQualifiedTypeInfoTranslator info : holder.getExtendsList()) { |
449 | if (!holder.getExtendedClassStore().get(info)) { | 449 | if (!holder.getExtendedClassStore().get(info)) { |
450 | def = def + info.getClassInfo() + COMMA + SPACE; | 450 | def = def + info.getClassInfo() + COMMA + SPACE; |
451 | } else { | 451 | } else { | ... | ... |
... | @@ -20,9 +20,9 @@ import java.util.List; | ... | @@ -20,9 +20,9 @@ import java.util.List; |
20 | 20 | ||
21 | import org.onosproject.yangutils.datamodel.YangNode; | 21 | import org.onosproject.yangutils.datamodel.YangNode; |
22 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 22 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
23 | -import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; | 23 | +import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator; |
24 | import org.onosproject.yangutils.translator.tojava.TempJavaServiceFragmentFiles; | 24 | import org.onosproject.yangutils.translator.tojava.TempJavaServiceFragmentFiles; |
25 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 25 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
26 | 26 | ||
27 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getEnumJavaAttribute; | 27 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getEnumJavaAttribute; |
28 | import static org.onosproject.yangutils.utils.UtilConstants.ACTIVATE_ANNOTATION_IMPORT; | 28 | import static org.onosproject.yangutils.utils.UtilConstants.ACTIVATE_ANNOTATION_IMPORT; |
... | @@ -105,7 +105,7 @@ public final class JavaCodeSnippetGen { | ... | @@ -105,7 +105,7 @@ public final class JavaCodeSnippetGen { |
105 | * @param importInfo import info | 105 | * @param importInfo import info |
106 | * @return the textual java code information corresponding to the import list | 106 | * @return the textual java code information corresponding to the import list |
107 | */ | 107 | */ |
108 | - static String getImportText(JavaQualifiedTypeInfo importInfo) { | 108 | + static String getImportText(JavaQualifiedTypeInfoTranslator importInfo) { |
109 | return IMPORT + importInfo.getPkgInfo() + PERIOD + importInfo.getClassInfo() + SEMI_COLAN + NEW_LINE; | 109 | return IMPORT + importInfo.getPkgInfo() + PERIOD + importInfo.getClassInfo() + SEMI_COLAN + NEW_LINE; |
110 | } | 110 | } |
111 | 111 | ... | ... |
... | @@ -22,10 +22,10 @@ import java.util.List; | ... | @@ -22,10 +22,10 @@ import java.util.List; |
22 | import java.util.Map; | 22 | import java.util.Map; |
23 | 23 | ||
24 | import org.onosproject.yangutils.datamodel.YangNode; | 24 | import org.onosproject.yangutils.datamodel.YangNode; |
25 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | 25 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
26 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; | 26 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; |
27 | import org.onosproject.yangutils.translator.tojava.JavaImportData; | 27 | import org.onosproject.yangutils.translator.tojava.JavaImportData; |
28 | -import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; | 28 | +import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator; |
29 | import org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles; | 29 | import org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles; |
30 | 30 | ||
31 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase; | 31 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase; |
... | @@ -36,8 +36,8 @@ import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase | ... | @@ -36,8 +36,8 @@ import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase |
36 | */ | 36 | */ |
37 | public class JavaExtendsListHolder { | 37 | public class JavaExtendsListHolder { |
38 | 38 | ||
39 | - private Map<JavaQualifiedTypeInfo, Boolean> extendedClassStore; | 39 | + private Map<JavaQualifiedTypeInfoTranslator, Boolean> extendedClassStore; |
40 | - private List<JavaQualifiedTypeInfo> extendsList; | 40 | + private List<JavaQualifiedTypeInfoTranslator> extendsList; |
41 | 41 | ||
42 | /** | 42 | /** |
43 | * Creates an instance of JavaExtendsListHolder. | 43 | * Creates an instance of JavaExtendsListHolder. |
... | @@ -52,7 +52,7 @@ public class JavaExtendsListHolder { | ... | @@ -52,7 +52,7 @@ public class JavaExtendsListHolder { |
52 | * | 52 | * |
53 | * @return extends list | 53 | * @return extends list |
54 | */ | 54 | */ |
55 | - public Map<JavaQualifiedTypeInfo, Boolean> getExtendedClassStore() { | 55 | + public Map<JavaQualifiedTypeInfoTranslator, Boolean> getExtendedClassStore() { |
56 | return extendedClassStore; | 56 | return extendedClassStore; |
57 | } | 57 | } |
58 | 58 | ||
... | @@ -61,7 +61,7 @@ public class JavaExtendsListHolder { | ... | @@ -61,7 +61,7 @@ public class JavaExtendsListHolder { |
61 | * | 61 | * |
62 | * @param extendedClass map of classes need to be extended | 62 | * @param extendedClass map of classes need to be extended |
63 | */ | 63 | */ |
64 | - private void setExtendedClassStore(Map<JavaQualifiedTypeInfo, Boolean> extendedClass) { | 64 | + private void setExtendedClassStore(Map<JavaQualifiedTypeInfoTranslator, Boolean> extendedClass) { |
65 | extendedClassStore = extendedClass; | 65 | extendedClassStore = extendedClass; |
66 | } | 66 | } |
67 | 67 | ||
... | @@ -72,7 +72,7 @@ public class JavaExtendsListHolder { | ... | @@ -72,7 +72,7 @@ public class JavaExtendsListHolder { |
72 | * @param node YANG node | 72 | * @param node YANG node |
73 | * @param tempJavaFragmentFiles temp java fragment files | 73 | * @param tempJavaFragmentFiles temp java fragment files |
74 | */ | 74 | */ |
75 | - public void addToExtendsList(JavaQualifiedTypeInfo info, YangNode node, | 75 | + public void addToExtendsList(JavaQualifiedTypeInfoTranslator info, YangNode node, |
76 | TempJavaFragmentFiles tempJavaFragmentFiles) { | 76 | TempJavaFragmentFiles tempJavaFragmentFiles) { |
77 | JavaFileInfo fileInfo = ((JavaFileInfoContainer) node).getJavaFileInfo(); | 77 | JavaFileInfo fileInfo = ((JavaFileInfoContainer) node).getJavaFileInfo(); |
78 | 78 | ||
... | @@ -91,7 +91,7 @@ public class JavaExtendsListHolder { | ... | @@ -91,7 +91,7 @@ public class JavaExtendsListHolder { |
91 | * | 91 | * |
92 | * @return the extendsList | 92 | * @return the extendsList |
93 | */ | 93 | */ |
94 | - public List<JavaQualifiedTypeInfo> getExtendsList() { | 94 | + public List<JavaQualifiedTypeInfoTranslator> getExtendsList() { |
95 | return extendsList; | 95 | return extendsList; |
96 | } | 96 | } |
97 | 97 | ||
... | @@ -100,7 +100,7 @@ public class JavaExtendsListHolder { | ... | @@ -100,7 +100,7 @@ public class JavaExtendsListHolder { |
100 | * | 100 | * |
101 | * @param classInfoList the extends List to set | 101 | * @param classInfoList the extends List to set |
102 | */ | 102 | */ |
103 | - private void setExtendsList(List<JavaQualifiedTypeInfo> classInfoList) { | 103 | + private void setExtendsList(List<JavaQualifiedTypeInfoTranslator> classInfoList) { |
104 | extendsList = classInfoList; | 104 | extendsList = classInfoList; |
105 | } | 105 | } |
106 | 106 | ||
... | @@ -109,7 +109,7 @@ public class JavaExtendsListHolder { | ... | @@ -109,7 +109,7 @@ public class JavaExtendsListHolder { |
109 | * | 109 | * |
110 | * @param classInfo class info | 110 | * @param classInfo class info |
111 | */ | 111 | */ |
112 | - private void addToExtendsList(JavaQualifiedTypeInfo classInfo) { | 112 | + private void addToExtendsList(JavaQualifiedTypeInfoTranslator classInfo) { |
113 | getExtendsList().add(classInfo); | 113 | getExtendsList().add(classInfo); |
114 | } | 114 | } |
115 | 115 | ... | ... |
... | @@ -23,6 +23,7 @@ import java.util.List; | ... | @@ -23,6 +23,7 @@ import java.util.List; |
23 | 23 | ||
24 | import org.onosproject.yangutils.datamodel.YangAugment; | 24 | import org.onosproject.yangutils.datamodel.YangAugment; |
25 | import org.onosproject.yangutils.datamodel.YangAugmentableNode; | 25 | import org.onosproject.yangutils.datamodel.YangAugmentableNode; |
26 | +import org.onosproject.yangutils.datamodel.YangDerivedInfo; | ||
26 | import org.onosproject.yangutils.datamodel.YangLeaf; | 27 | import org.onosproject.yangutils.datamodel.YangLeaf; |
27 | import org.onosproject.yangutils.datamodel.YangLeafList; | 28 | import org.onosproject.yangutils.datamodel.YangLeafList; |
28 | import org.onosproject.yangutils.datamodel.YangLeavesHolder; | 29 | import org.onosproject.yangutils.datamodel.YangLeavesHolder; |
... | @@ -34,16 +35,16 @@ import org.onosproject.yangutils.datamodel.YangTypeDef; | ... | @@ -34,16 +35,16 @@ import org.onosproject.yangutils.datamodel.YangTypeDef; |
34 | import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; | 35 | import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
35 | import org.onosproject.yangutils.translator.tojava.JavaAttributeInfo; | 36 | import org.onosproject.yangutils.translator.tojava.JavaAttributeInfo; |
36 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 37 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
37 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | 38 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
38 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; | 39 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; |
39 | -import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; | 40 | +import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator; |
40 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer; | 41 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer; |
41 | import org.onosproject.yangutils.translator.tojava.TempJavaEnumerationFragmentFiles; | 42 | import org.onosproject.yangutils.translator.tojava.TempJavaEnumerationFragmentFiles; |
42 | import org.onosproject.yangutils.translator.tojava.TempJavaEventFragmentFiles; | 43 | import org.onosproject.yangutils.translator.tojava.TempJavaEventFragmentFiles; |
43 | import org.onosproject.yangutils.translator.tojava.TempJavaServiceFragmentFiles; | 44 | import org.onosproject.yangutils.translator.tojava.TempJavaServiceFragmentFiles; |
44 | import org.onosproject.yangutils.translator.tojava.TempJavaTypeFragmentFiles; | 45 | import org.onosproject.yangutils.translator.tojava.TempJavaTypeFragmentFiles; |
45 | import org.onosproject.yangutils.translator.tojava.YangJavaModelUtils; | 46 | import org.onosproject.yangutils.translator.tojava.YangJavaModelUtils; |
46 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 47 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
47 | 48 | ||
48 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK; | 49 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK; |
49 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_INTERFACE_MASK; | 50 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_INTERFACE_MASK; |
... | @@ -79,7 +80,7 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType. | ... | @@ -79,7 +80,7 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType. |
79 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_INTERFACE_MASK; | 80 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_INTERFACE_MASK; |
80 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.TO_STRING_IMPL_MASK; | 81 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.TO_STRING_IMPL_MASK; |
81 | import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; | 82 | import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; |
82 | -import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfCurNode; | 83 | +import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator.getQualifiedTypeInfoOfCurNode; |
83 | import static org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles.getCurNodeAsAttributeInTarget; | 84 | import static org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles.getCurNodeAsAttributeInTarget; |
84 | import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.addAugmentationAttribute; | 85 | import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.addAugmentationAttribute; |
85 | import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getEnumsValueAttribute; | 86 | import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getEnumsValueAttribute; |
... | @@ -816,6 +817,7 @@ public final class JavaFileGenerator { | ... | @@ -816,6 +817,7 @@ public final class JavaFileGenerator { |
816 | YangTypeDef typeDef = (YangTypeDef) curNode; | 817 | YangTypeDef typeDef = (YangTypeDef) curNode; |
817 | List<YangType<?>> types = typeDef.getTypeList(); | 818 | List<YangType<?>> types = typeDef.getTypeList(); |
818 | YangType type = types.get(0); | 819 | YangType type = types.get(0); |
820 | + YangDataTypes yangDataTypes = type.getDataType(); | ||
819 | if (type.getDataType().equals(YangDataTypes.BINARY)) { | 821 | if (type.getDataType().equals(YangDataTypes.BINARY)) { |
820 | imports.add(IMPORT + JAVA_UTIL_OBJECTS_IMPORT_PKG + PERIOD + JAVA_UTIL_IMPORT_BASE64_CLASS); | 822 | imports.add(IMPORT + JAVA_UTIL_OBJECTS_IMPORT_PKG + PERIOD + JAVA_UTIL_IMPORT_BASE64_CLASS); |
821 | } | 823 | } |
... | @@ -878,7 +880,7 @@ public final class JavaFileGenerator { | ... | @@ -878,7 +880,7 @@ public final class JavaFileGenerator { |
878 | 880 | ||
879 | //To string method. | 881 | //To string method. |
880 | if (type.getDataType().equals(YangDataTypes.BINARY)) { | 882 | if (type.getDataType().equals(YangDataTypes.BINARY)) { |
881 | - JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(curNode, | 883 | + JavaQualifiedTypeInfoTranslator qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(curNode, |
882 | getCapitalCase("binary")); | 884 | getCapitalCase("binary")); |
883 | 885 | ||
884 | JavaAttributeInfo attr = getAttributeInfoForTheData(qualifiedTypeInfo, "binary", null, false, | 886 | JavaAttributeInfo attr = getAttributeInfoForTheData(qualifiedTypeInfo, "binary", null, false, |
... | @@ -892,7 +894,7 @@ public final class JavaFileGenerator { | ... | @@ -892,7 +894,7 @@ public final class JavaFileGenerator { |
892 | + SEMI_COLAN + NEW_LINE + FOUR_SPACE_INDENTATION + CLOSE_CURLY_BRACKET + NEW_LINE; | 894 | + SEMI_COLAN + NEW_LINE + FOUR_SPACE_INDENTATION + CLOSE_CURLY_BRACKET + NEW_LINE; |
893 | methods.add(bitsToStringMethod); | 895 | methods.add(bitsToStringMethod); |
894 | } else if (type.getDataType().equals(YangDataTypes.BITS)) { | 896 | } else if (type.getDataType().equals(YangDataTypes.BITS)) { |
895 | - JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(curNode, | 897 | + JavaQualifiedTypeInfoTranslator qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(curNode, |
896 | getCapitalCase("bits")); | 898 | getCapitalCase("bits")); |
897 | 899 | ||
898 | JavaAttributeInfo attr = getAttributeInfoForTheData(qualifiedTypeInfo, "bits", null, false, false); | 900 | JavaAttributeInfo attr = getAttributeInfoForTheData(qualifiedTypeInfo, "bits", null, false, false); |
... | @@ -912,11 +914,26 @@ public final class JavaFileGenerator { | ... | @@ -912,11 +914,26 @@ public final class JavaFileGenerator { |
912 | 914 | ||
913 | JavaCodeGeneratorInfo javaGenInfo = (JavaCodeGeneratorInfo) curNode; | 915 | JavaCodeGeneratorInfo javaGenInfo = (JavaCodeGeneratorInfo) curNode; |
914 | 916 | ||
917 | + if ((type.getDataType().equals(YangDataTypes.DERIVED)) | ||
918 | + && (((YangDerivedInfo) type.getDataTypeExtendedInfo()).getEffectiveBuiltInType() | ||
919 | + .equals(YangDataTypes.IDENTITYREF))) { | ||
920 | + yangDataTypes = YangDataTypes.IDENTITYREF; | ||
921 | + } | ||
922 | + | ||
923 | + if (type.getDataType().equals(YangDataTypes.IDENTITYREF)) { | ||
924 | + yangDataTypes = YangDataTypes.IDENTITYREF; | ||
925 | + } | ||
926 | + | ||
927 | + if (!yangDataTypes.equals(YangDataTypes.IDENTITYREF)) { | ||
928 | + | ||
929 | + | ||
915 | //From string method. | 930 | //From string method. |
916 | methods.add(getFromStringMethodSignature(className, pluginConfig) | 931 | methods.add(getFromStringMethodSignature(className, pluginConfig) |
917 | - + getDataFromTempFileHandle(FROM_STRING_IMPL_MASK, javaGenInfo.getTempJavaCodeFragmentFiles() | 932 | + + getDataFromTempFileHandle(FROM_STRING_IMPL_MASK, javaGenInfo |
933 | + .getTempJavaCodeFragmentFiles() | ||
918 | .getTypeTempFiles(), path) | 934 | .getTypeTempFiles(), path) |
919 | + getFromStringMethodClose()); | 935 | + getFromStringMethodClose()); |
936 | + } | ||
920 | 937 | ||
921 | } catch (IOException e) { | 938 | } catch (IOException e) { |
922 | throw new IOException("No data found in temporary java code fragment files for " + className | 939 | throw new IOException("No data found in temporary java code fragment files for " + className | ... | ... |
... | @@ -25,12 +25,13 @@ import org.onosproject.yangutils.datamodel.YangAtomicPath; | ... | @@ -25,12 +25,13 @@ import org.onosproject.yangutils.datamodel.YangAtomicPath; |
25 | import org.onosproject.yangutils.datamodel.YangAugment; | 25 | import org.onosproject.yangutils.datamodel.YangAugment; |
26 | import org.onosproject.yangutils.datamodel.YangNode; | 26 | import org.onosproject.yangutils.datamodel.YangNode; |
27 | import org.onosproject.yangutils.datamodel.YangNodeIdentifier; | 27 | import org.onosproject.yangutils.datamodel.YangNodeIdentifier; |
28 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; | ||
29 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
28 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 30 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
29 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | 31 | import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
30 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | ||
31 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; | 32 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; |
32 | import org.onosproject.yangutils.translator.tojava.JavaImportData; | 33 | import org.onosproject.yangutils.translator.tojava.JavaImportData; |
33 | -import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; | 34 | +import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator; |
34 | import org.onosproject.yangutils.translator.tojava.TempJavaBeanFragmentFiles; | 35 | import org.onosproject.yangutils.translator.tojava.TempJavaBeanFragmentFiles; |
35 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | 36 | import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
36 | import org.onosproject.yangutils.translator.tojava.TempJavaEnumerationFragmentFiles; | 37 | import org.onosproject.yangutils.translator.tojava.TempJavaEnumerationFragmentFiles; |
... | @@ -40,7 +41,6 @@ import org.onosproject.yangutils.translator.tojava.TempJavaServiceFragmentFiles; | ... | @@ -40,7 +41,6 @@ import org.onosproject.yangutils.translator.tojava.TempJavaServiceFragmentFiles; |
40 | import org.onosproject.yangutils.translator.tojava.TempJavaTypeFragmentFiles; | 41 | import org.onosproject.yangutils.translator.tojava.TempJavaTypeFragmentFiles; |
41 | import org.onosproject.yangutils.utils.io.impl.CopyrightHeader; | 42 | import org.onosproject.yangutils.utils.io.impl.CopyrightHeader; |
42 | import org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType; | 43 | import org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType; |
43 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ||
44 | 44 | ||
45 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK; | 45 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK; |
46 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_INTERFACE_MASK; | 46 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_INTERFACE_MASK; |
... | @@ -76,7 +76,7 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType. | ... | @@ -76,7 +76,7 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType. |
76 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_CLASS_MASK; | 76 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_CLASS_MASK; |
77 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_INTERFACE_MASK; | 77 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_INTERFACE_MASK; |
78 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.TO_STRING_IMPL_MASK; | 78 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.TO_STRING_IMPL_MASK; |
79 | -import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfCurNode; | 79 | +import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator.getQualifiedTypeInfoOfCurNode; |
80 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.getAugmentedNodesPackage; | 80 | import static org.onosproject.yangutils.translator.tojava.YangJavaModelUtils.getAugmentedNodesPackage; |
81 | import static org.onosproject.yangutils.translator.tojava.utils.ClassDefinitionGenerator.generateClassDefinition; | 81 | import static org.onosproject.yangutils.translator.tojava.utils.ClassDefinitionGenerator.generateClassDefinition; |
82 | import static org.onosproject.yangutils.utils.UtilConstants.CLOSE_CURLY_BRACKET; | 82 | import static org.onosproject.yangutils.utils.UtilConstants.CLOSE_CURLY_BRACKET; |
... | @@ -343,7 +343,7 @@ public final class JavaFileGeneratorUtils { | ... | @@ -343,7 +343,7 @@ public final class JavaFileGeneratorUtils { |
343 | * @param importsList list of java imports | 343 | * @param importsList list of java imports |
344 | * @param curNode current YANG node | 344 | * @param curNode current YANG node |
345 | * @param className class name | 345 | * @param className class name |
346 | - * @throws IOException | 346 | + * @throws IOException when fails to do IO operations |
347 | */ | 347 | */ |
348 | private static void appendContents(File file, int genType, List<String> importsList, YangNode curNode, | 348 | private static void appendContents(File file, int genType, List<String> importsList, YangNode curNode, |
349 | String className) | 349 | String className) |
... | @@ -597,7 +597,7 @@ public final class JavaFileGeneratorUtils { | ... | @@ -597,7 +597,7 @@ public final class JavaFileGeneratorUtils { |
597 | TempJavaCodeFragmentFiles tempJavaCodeFragmentFiles = ((JavaCodeGeneratorInfo) parent) | 597 | TempJavaCodeFragmentFiles tempJavaCodeFragmentFiles = ((JavaCodeGeneratorInfo) parent) |
598 | .getTempJavaCodeFragmentFiles(); | 598 | .getTempJavaCodeFragmentFiles(); |
599 | YangNode augmentedNode; | 599 | YangNode augmentedNode; |
600 | - JavaQualifiedTypeInfo javaQualifiedTypeInfo; | 600 | + JavaQualifiedTypeInfoTranslator javaQualifiedTypeInfo; |
601 | String curNodeName; | 601 | String curNodeName; |
602 | JavaFileInfo parentInfo = ((JavaFileInfoContainer) parent).getJavaFileInfo(); | 602 | JavaFileInfo parentInfo = ((JavaFileInfoContainer) parent).getJavaFileInfo(); |
603 | for (YangAtomicPath nodeId : targets) { | 603 | for (YangAtomicPath nodeId : targets) { |
... | @@ -625,9 +625,10 @@ public final class JavaFileGeneratorUtils { | ... | @@ -625,9 +625,10 @@ public final class JavaFileGeneratorUtils { |
625 | * @param pluginConfig plugin configurations | 625 | * @param pluginConfig plugin configurations |
626 | * @return qualified type info of augmented node | 626 | * @return qualified type info of augmented node |
627 | */ | 627 | */ |
628 | - private static JavaQualifiedTypeInfo getQualifiedTypeInfoOfAugmentedNode(YangNode augmentedNode, String curNodeName, | 628 | + private static JavaQualifiedTypeInfoTranslator getQualifiedTypeInfoOfAugmentedNode(YangNode augmentedNode, |
629 | + String curNodeName, | ||
629 | YangPluginConfig pluginConfig) { | 630 | YangPluginConfig pluginConfig) { |
630 | - JavaQualifiedTypeInfo javaQualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(augmentedNode, | 631 | + JavaQualifiedTypeInfoTranslator javaQualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(augmentedNode, |
631 | getCapitalCase(curNodeName)); | 632 | getCapitalCase(curNodeName)); |
632 | if (javaQualifiedTypeInfo.getPkgInfo() == null) { | 633 | if (javaQualifiedTypeInfo.getPkgInfo() == null) { |
633 | javaQualifiedTypeInfo.setPkgInfo(getAugmentedNodesPackage(augmentedNode, | 634 | javaQualifiedTypeInfo.setPkgInfo(getAugmentedNodesPackage(augmentedNode, |
... | @@ -643,9 +644,9 @@ public final class JavaFileGeneratorUtils { | ... | @@ -643,9 +644,9 @@ public final class JavaFileGeneratorUtils { |
643 | * @param importData import data | 644 | * @param importData import data |
644 | * @return true if present in imports | 645 | * @return true if present in imports |
645 | */ | 646 | */ |
646 | - private static boolean validateQualifiedInfoOfAugmentedNode(JavaQualifiedTypeInfo javaQualifiedTypeInfo, | 647 | + private static boolean validateQualifiedInfoOfAugmentedNode(JavaQualifiedTypeInfoTranslator javaQualifiedTypeInfo, |
647 | JavaImportData importData) { | 648 | JavaImportData importData) { |
648 | - for (JavaQualifiedTypeInfo curImportInfo : importData.getImportSet()) { | 649 | + for (JavaQualifiedTypeInfoTranslator curImportInfo : importData.getImportSet()) { |
649 | if (curImportInfo.getClassInfo() | 650 | if (curImportInfo.getClassInfo() |
650 | .contentEquals(javaQualifiedTypeInfo.getClassInfo())) { | 651 | .contentEquals(javaQualifiedTypeInfo.getClassInfo())) { |
651 | return curImportInfo.getPkgInfo() | 652 | return curImportInfo.getPkgInfo() |
... | @@ -664,7 +665,7 @@ public final class JavaFileGeneratorUtils { | ... | @@ -664,7 +665,7 @@ public final class JavaFileGeneratorUtils { |
664 | */ | 665 | */ |
665 | static String getAugmentedClassNameForDataMethods(YangNode augmentedNode, YangNode parent) { | 666 | static String getAugmentedClassNameForDataMethods(YangNode augmentedNode, YangNode parent) { |
666 | String curNodeName; | 667 | String curNodeName; |
667 | - JavaQualifiedTypeInfo javaQualifiedTypeInfo; | 668 | + JavaQualifiedTypeInfoTranslator javaQualifiedTypeInfo; |
668 | JavaFileInfo parentInfo = ((JavaFileInfoContainer) parent).getJavaFileInfo(); | 669 | JavaFileInfo parentInfo = ((JavaFileInfoContainer) parent).getJavaFileInfo(); |
669 | YangPluginConfig pluginConfig = parentInfo.getPluginConfig(); | 670 | YangPluginConfig pluginConfig = parentInfo.getPluginConfig(); |
670 | TempJavaServiceFragmentFiles tempJavaServiceFragmentFiles = ((JavaCodeGeneratorInfo) parent) | 671 | TempJavaServiceFragmentFiles tempJavaServiceFragmentFiles = ((JavaCodeGeneratorInfo) parent) | ... | ... |
... | @@ -24,10 +24,10 @@ import java.util.Date; | ... | @@ -24,10 +24,10 @@ import java.util.Date; |
24 | import java.util.List; | 24 | import java.util.List; |
25 | import org.onosproject.yangutils.datamodel.YangNode; | 25 | import org.onosproject.yangutils.datamodel.YangNode; |
26 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 26 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
27 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | 27 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
28 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; | 28 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; |
29 | import org.onosproject.yangutils.utils.io.impl.YangIoUtils; | 29 | import org.onosproject.yangutils.utils.io.impl.YangIoUtils; |
30 | -import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil; | 30 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangToJavaNamingConflictUtil; |
31 | 31 | ||
32 | import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.getParentNodeInGenCode; | 32 | import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.getParentNodeInGenCode; |
33 | import static org.onosproject.yangutils.utils.UtilConstants.COLAN; | 33 | import static org.onosproject.yangutils.utils.UtilConstants.COLAN; | ... | ... |
... | @@ -34,7 +34,7 @@ import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; | ... | @@ -34,7 +34,7 @@ import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo; |
34 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; | 34 | import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; |
35 | import org.onosproject.yangutils.translator.tojava.TempJavaBeanFragmentFiles; | 35 | import org.onosproject.yangutils.translator.tojava.TempJavaBeanFragmentFiles; |
36 | import org.onosproject.yangutils.utils.io.impl.JavaDocGen; | 36 | import org.onosproject.yangutils.utils.io.impl.JavaDocGen; |
37 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 37 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
38 | 38 | ||
39 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BINARY; | 39 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BINARY; |
40 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BITS; | 40 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BITS; |
... | @@ -1630,6 +1630,8 @@ public final class MethodsGenerator { | ... | @@ -1630,6 +1630,8 @@ public final class MethodsGenerator { |
1630 | return NEW + SPACE + BIG_DECIMAL; | 1630 | return NEW + SPACE + BIG_DECIMAL; |
1631 | case STRING: | 1631 | case STRING: |
1632 | return EMPTY_STRING; | 1632 | return EMPTY_STRING; |
1633 | + case IDENTITYREF: | ||
1634 | + return EMPTY_STRING; | ||
1633 | case EMPTY: | 1635 | case EMPTY: |
1634 | case BOOLEAN: | 1636 | case BOOLEAN: |
1635 | return BOOLEAN_WRAPPER + PERIOD + PARSE_BOOLEAN; | 1637 | return BOOLEAN_WRAPPER + PERIOD + PARSE_BOOLEAN; | ... | ... |
... | @@ -16,6 +16,8 @@ | ... | @@ -16,6 +16,8 @@ |
16 | 16 | ||
17 | package org.onosproject.yangutils.utils.io.impl; | 17 | package org.onosproject.yangutils.utils.io.impl; |
18 | 18 | ||
19 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
20 | + | ||
19 | import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTED; | 21 | import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTED; |
20 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_DOC_FOR_VALIDATOR; | 22 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_DOC_FOR_VALIDATOR; |
21 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_DOC_FOR_VALIDATOR_RETURN; | 23 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_DOC_FOR_VALIDATOR_RETURN; | ... | ... |
... | @@ -30,6 +30,8 @@ import java.util.Stack; | ... | @@ -30,6 +30,8 @@ import java.util.Stack; |
30 | import java.util.regex.Pattern; | 30 | import java.util.regex.Pattern; |
31 | 31 | ||
32 | import org.apache.commons.io.FileUtils; | 32 | import org.apache.commons.io.FileUtils; |
33 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
34 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangToJavaNamingConflictUtil; | ||
33 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 35 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
34 | 36 | ||
35 | import static org.onosproject.yangutils.utils.UtilConstants.COLAN; | 37 | import static org.onosproject.yangutils.utils.UtilConstants.COLAN; | ... | ... |
... | @@ -25,7 +25,7 @@ import org.onosproject.yangutils.parser.exceptions.ParserException; | ... | @@ -25,7 +25,7 @@ import org.onosproject.yangutils.parser.exceptions.ParserException; |
25 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; | 25 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; |
26 | import org.onosproject.yangutils.plugin.manager.YangUtilManager; | 26 | import org.onosproject.yangutils.plugin.manager.YangUtilManager; |
27 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; | 27 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; |
28 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 28 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
29 | 29 | ||
30 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; | 30 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; |
31 | 31 | ... | ... |
... | @@ -22,7 +22,7 @@ import org.apache.maven.plugin.MojoExecutionException; | ... | @@ -22,7 +22,7 @@ import org.apache.maven.plugin.MojoExecutionException; |
22 | import org.junit.Test; | 22 | import org.junit.Test; |
23 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 23 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
24 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; | 24 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; |
25 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 25 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
26 | 26 | ||
27 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; | 27 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; |
28 | 28 | ... | ... |
... | @@ -22,7 +22,7 @@ import org.junit.Test; | ... | @@ -22,7 +22,7 @@ import org.junit.Test; |
22 | import org.onosproject.yangutils.datamodel.YangNode; | 22 | import org.onosproject.yangutils.datamodel.YangNode; |
23 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 23 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
24 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; | 24 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; |
25 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 25 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
26 | 26 | ||
27 | import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; | 27 | import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; |
28 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; | 28 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; | ... | ... |
... | @@ -22,7 +22,7 @@ import org.junit.Test; | ... | @@ -22,7 +22,7 @@ import org.junit.Test; |
22 | import org.onosproject.yangutils.datamodel.YangNode; | 22 | import org.onosproject.yangutils.datamodel.YangNode; |
23 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 23 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
24 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; | 24 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; |
25 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 25 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
26 | 26 | ||
27 | import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; | 27 | import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; |
28 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; | 28 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; | ... | ... |
... | @@ -40,7 +40,7 @@ import org.onosproject.yangutils.linker.impl.YangLinkerManager; | ... | @@ -40,7 +40,7 @@ import org.onosproject.yangutils.linker.impl.YangLinkerManager; |
40 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 40 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
41 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; | 41 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; |
42 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; | 42 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; |
43 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 43 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
44 | 44 | ||
45 | import static org.hamcrest.CoreMatchers.nullValue; | 45 | import static org.hamcrest.CoreMatchers.nullValue; |
46 | import static org.hamcrest.MatcherAssert.assertThat; | 46 | import static org.hamcrest.MatcherAssert.assertThat; | ... | ... |
... | @@ -37,7 +37,7 @@ import org.onosproject.yangutils.datamodel.YangGrouping; | ... | @@ -37,7 +37,7 @@ import org.onosproject.yangutils.datamodel.YangGrouping; |
37 | import org.onosproject.yangutils.datamodel.YangLeaf; | 37 | import org.onosproject.yangutils.datamodel.YangLeaf; |
38 | import org.onosproject.yangutils.datamodel.YangNode; | 38 | import org.onosproject.yangutils.datamodel.YangNode; |
39 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; | 39 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; |
40 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 40 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
41 | 41 | ||
42 | import static org.hamcrest.MatcherAssert.assertThat; | 42 | import static org.hamcrest.MatcherAssert.assertThat; |
43 | import static org.hamcrest.core.Is.is; | 43 | import static org.hamcrest.core.Is.is; | ... | ... |
... | @@ -23,7 +23,7 @@ import org.apache.maven.plugin.MojoExecutionException; | ... | @@ -23,7 +23,7 @@ import org.apache.maven.plugin.MojoExecutionException; |
23 | import org.junit.Test; | 23 | import org.junit.Test; |
24 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 24 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
25 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; | 25 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; |
26 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 26 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
27 | 27 | ||
28 | import static org.hamcrest.core.Is.is; | 28 | import static org.hamcrest.core.Is.is; |
29 | import static org.junit.Assert.assertThat; | 29 | import static org.junit.Assert.assertThat; | ... | ... |
... | @@ -22,7 +22,7 @@ import org.junit.Test; | ... | @@ -22,7 +22,7 @@ import org.junit.Test; |
22 | import org.onosproject.yangutils.datamodel.YangNode; | 22 | import org.onosproject.yangutils.datamodel.YangNode; |
23 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 23 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
24 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; | 24 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; |
25 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 25 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
26 | 26 | ||
27 | import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; | 27 | import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; |
28 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; | 28 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; | ... | ... |
utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/plugin/manager/RpcTranslatorTest.java
... | @@ -22,7 +22,7 @@ import org.junit.Test; | ... | @@ -22,7 +22,7 @@ import org.junit.Test; |
22 | import org.onosproject.yangutils.datamodel.YangNode; | 22 | import org.onosproject.yangutils.datamodel.YangNode; |
23 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 23 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
24 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; | 24 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; |
25 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 25 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
26 | 26 | ||
27 | import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; | 27 | import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; |
28 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; | 28 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; | ... | ... |
... | @@ -22,7 +22,7 @@ import org.apache.maven.plugin.MojoExecutionException; | ... | @@ -22,7 +22,7 @@ import org.apache.maven.plugin.MojoExecutionException; |
22 | import org.junit.Test; | 22 | import org.junit.Test; |
23 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 23 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
24 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; | 24 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; |
25 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 25 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
26 | 26 | ||
27 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; | 27 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; |
28 | 28 | ... | ... |
... | @@ -24,7 +24,7 @@ import org.onosproject.yangutils.datamodel.YangNode; | ... | @@ -24,7 +24,7 @@ import org.onosproject.yangutils.datamodel.YangNode; |
24 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 24 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
25 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; | 25 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; |
26 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; | 26 | import org.onosproject.yangutils.utils.io.impl.YangFileScanner; |
27 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 27 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
28 | 28 | ||
29 | import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; | 29 | import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; |
30 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; | 30 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; | ... | ... |
... | @@ -24,8 +24,8 @@ import org.onosproject.yangutils.datamodel.YangDerivedInfo; | ... | @@ -24,8 +24,8 @@ import org.onosproject.yangutils.datamodel.YangDerivedInfo; |
24 | import org.onosproject.yangutils.datamodel.YangNode; | 24 | import org.onosproject.yangutils.datamodel.YangNode; |
25 | import org.onosproject.yangutils.datamodel.YangType; | 25 | import org.onosproject.yangutils.datamodel.YangType; |
26 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; | 26 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; |
27 | -import org.onosproject.yangutils.translator.tojava.JavaFileInfo; | 27 | +import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
28 | -import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil; | 28 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangToJavaNamingConflictUtil; |
29 | 29 | ||
30 | import static org.hamcrest.core.Is.is; | 30 | import static org.hamcrest.core.Is.is; |
31 | import static org.hamcrest.core.IsNot.not; | 31 | import static org.hamcrest.core.IsNot.not; |
... | @@ -168,7 +168,7 @@ public class AttributesJavaDataTypeTest { | ... | @@ -168,7 +168,7 @@ public class AttributesJavaDataTypeTest { |
168 | */ | 168 | */ |
169 | @SuppressWarnings("unchecked") | 169 | @SuppressWarnings("unchecked") |
170 | private YangType<?> getStubExtendedInfo(YangType<?> type) throws DataModelException { | 170 | private YangType<?> getStubExtendedInfo(YangType<?> type) throws DataModelException { |
171 | - YangJavaTypeDef typedef = new YangJavaTypeDef(); | 171 | + YangJavaTypeDefTranslator typedef = new YangJavaTypeDefTranslator(); |
172 | getStubParent().addChild(typedef); | 172 | getStubParent().addChild(typedef); |
173 | YangDerivedInfo<?> derInfo = new YangDerivedInfo<>(); | 173 | YangDerivedInfo<?> derInfo = new YangDerivedInfo<>(); |
174 | derInfo.setReferredTypeDef(typedef); | 174 | derInfo.setReferredTypeDef(typedef); |
... | @@ -194,7 +194,7 @@ public class AttributesJavaDataTypeTest { | ... | @@ -194,7 +194,7 @@ public class AttributesJavaDataTypeTest { |
194 | * @return stub parent module | 194 | * @return stub parent module |
195 | */ | 195 | */ |
196 | private YangNode getStubParent() { | 196 | private YangNode getStubParent() { |
197 | - YangJavaModule parent = new YangJavaModule(); | 197 | + YangJavaModuleTranslator parent = new YangJavaModuleTranslator(); |
198 | parent.setJavaFileInfo(addStubJavaFileInfo()); | 198 | parent.setJavaFileInfo(addStubJavaFileInfo()); |
199 | return parent; | 199 | return parent; |
200 | } | 200 | } | ... | ... |
... | @@ -20,7 +20,7 @@ import java.lang.reflect.Constructor; | ... | @@ -20,7 +20,7 @@ import java.lang.reflect.Constructor; |
20 | import java.lang.reflect.InvocationTargetException; | 20 | import java.lang.reflect.InvocationTargetException; |
21 | 21 | ||
22 | import org.junit.Test; | 22 | import org.junit.Test; |
23 | -import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; | 23 | +import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator; |
24 | 24 | ||
25 | import static org.hamcrest.MatcherAssert.assertThat; | 25 | import static org.hamcrest.MatcherAssert.assertThat; |
26 | import static org.hamcrest.core.Is.is; | 26 | import static org.hamcrest.core.Is.is; |
... | @@ -78,7 +78,7 @@ public class JavaCodeSnippetGenTest { | ... | @@ -78,7 +78,7 @@ public class JavaCodeSnippetGenTest { |
78 | */ | 78 | */ |
79 | @Test | 79 | @Test |
80 | public void testForImportText() { | 80 | public void testForImportText() { |
81 | - JavaQualifiedTypeInfo importInfo = new JavaQualifiedTypeInfo(); | 81 | + JavaQualifiedTypeInfoTranslator importInfo = new JavaQualifiedTypeInfoTranslator(); |
82 | importInfo.setPkgInfo(PKG_INFO); | 82 | importInfo.setPkgInfo(PKG_INFO); |
83 | importInfo.setClassInfo(CLASS_INFO); | 83 | importInfo.setClassInfo(CLASS_INFO); |
84 | 84 | ... | ... |
... | @@ -27,7 +27,7 @@ import org.junit.Rule; | ... | @@ -27,7 +27,7 @@ import org.junit.Rule; |
27 | import org.junit.Test; | 27 | import org.junit.Test; |
28 | import org.junit.rules.ExpectedException; | 28 | import org.junit.rules.ExpectedException; |
29 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 29 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
30 | -import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil; | 30 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangToJavaNamingConflictUtil; |
31 | 31 | ||
32 | import static org.apache.commons.io.FileUtils.deleteDirectory; | 32 | import static org.apache.commons.io.FileUtils.deleteDirectory; |
33 | import static org.hamcrest.core.Is.is; | 33 | import static org.hamcrest.core.Is.is; | ... | ... |
... | @@ -22,8 +22,8 @@ import java.lang.reflect.InvocationTargetException; | ... | @@ -22,8 +22,8 @@ import java.lang.reflect.InvocationTargetException; |
22 | import org.junit.Test; | 22 | import org.junit.Test; |
23 | import org.onosproject.yangutils.datamodel.YangType; | 23 | import org.onosproject.yangutils.datamodel.YangType; |
24 | import org.onosproject.yangutils.translator.tojava.JavaAttributeInfo; | 24 | import org.onosproject.yangutils.translator.tojava.JavaAttributeInfo; |
25 | -import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; | 25 | +import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator; |
26 | -import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 26 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
27 | 27 | ||
28 | import static org.hamcrest.core.Is.is; | 28 | import static org.hamcrest.core.Is.is; |
29 | import static org.hamcrest.core.IsNot.not; | 29 | import static org.hamcrest.core.IsNot.not; |
... | @@ -297,8 +297,8 @@ public final class MethodsGeneratorTest { | ... | @@ -297,8 +297,8 @@ public final class MethodsGeneratorTest { |
297 | * | 297 | * |
298 | * @return java qualified info | 298 | * @return java qualified info |
299 | */ | 299 | */ |
300 | - private JavaQualifiedTypeInfo getTestJavaQualifiedTypeInfo() { | 300 | + private JavaQualifiedTypeInfoTranslator getTestJavaQualifiedTypeInfo() { |
301 | - JavaQualifiedTypeInfo info = new JavaQualifiedTypeInfo(); | 301 | + JavaQualifiedTypeInfoTranslator info = new JavaQualifiedTypeInfoTranslator(); |
302 | info.setPkgInfo(JAVA_LANG); | 302 | info.setPkgInfo(JAVA_LANG); |
303 | info.setClassInfo(STRING_DATA_TYPE); | 303 | info.setClassInfo(STRING_DATA_TYPE); |
304 | return info; | 304 | return info; | ... | ... |
... | @@ -22,6 +22,7 @@ import java.lang.reflect.InvocationTargetException; | ... | @@ -22,6 +22,7 @@ import java.lang.reflect.InvocationTargetException; |
22 | import org.junit.Rule; | 22 | import org.junit.Rule; |
23 | import org.junit.Test; | 23 | import org.junit.Test; |
24 | import org.junit.rules.ExpectedException; | 24 | import org.junit.rules.ExpectedException; |
25 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
25 | 26 | ||
26 | import static org.hamcrest.core.Is.is; | 27 | import static org.hamcrest.core.Is.is; |
27 | import static org.hamcrest.core.IsNot.not; | 28 | import static org.hamcrest.core.IsNot.not; | ... | ... |
... | @@ -24,6 +24,7 @@ import org.apache.commons.io.FileUtils; | ... | @@ -24,6 +24,7 @@ import org.apache.commons.io.FileUtils; |
24 | import org.junit.Rule; | 24 | import org.junit.Rule; |
25 | import org.junit.Test; | 25 | import org.junit.Test; |
26 | import org.junit.rules.ExpectedException; | 26 | import org.junit.rules.ExpectedException; |
27 | +import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; | ||
27 | import org.onosproject.yangutils.utils.UtilConstants; | 28 | import org.onosproject.yangutils.utils.UtilConstants; |
28 | 29 | ||
29 | import static org.hamcrest.core.Is.is; | 30 | import static org.hamcrest.core.Is.is; | ... | ... |
-
Please register or login to post a comment