1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.oqt.core;
17
18 import java.text.MessageFormat;
19 import java.util.Collection;
20 import java.util.TreeSet;
21
22 import net.sf.oqt.model.EntityVO;
23 import net.sf.oqt.model.PackageVO;
24 import net.sf.oqt.model.ResultVO;
25
26
27
28
29
30
31
32
33 public class CoreProperties {
34
35 CoreProperties() {
36
37 }
38
39
40
41
42 private String url = "";
43
44
45
46 private String username = "";
47
48
49
50 private String password = "";
51
52
53
54 private String driverName = "";
55
56
57
58
59 private String dictionary = "";
60
61
62
63
64 private final Collection<String> packageNames = new TreeSet<String>();
65
66
67
68 private final Collection<String> fqns = new TreeSet<String>();
69
70
71
72
73 private String jpaVersion = "";
74
75 public final String getUrl() {
76 return url;
77 }
78
79 public final void setUrl(final String url) {
80 this.url = url;
81 }
82
83 public final String getUsername() {
84 return username;
85 }
86
87 public final void setUsername(final String username) {
88 this.username = username;
89 }
90
91 public final String getPassword() {
92 return password;
93 }
94
95 public final void setPassword(final String password) {
96 this.password = password;
97 }
98
99 public final String getDriverName() {
100 return driverName;
101 }
102
103 public final void setDriverName(final String driverName) {
104 this.driverName = driverName;
105 }
106
107 public final String getDictionary() {
108 return dictionary;
109 }
110
111 public final void setDictionary(final String dictionary) {
112 this.dictionary = dictionary;
113 }
114
115 public final Collection<String> getFqns() {
116 return fqns;
117 }
118
119 public final Collection<String> getPackageNames() {
120 return packageNames;
121 }
122
123 public final String getJpaVersion() {
124 return jpaVersion;
125 }
126
127 final void setJpaVersion(final String jpaVersion) {
128 this.jpaVersion = jpaVersion;
129 }
130
131
132
133
134
135
136
137 public final void setFqnsFromResult(final ResultVO result) {
138 String pattern = "{0}.{1}";
139 fqns.clear();
140 Collection<PackageVO> packages = result.getPackages();
141 for (final PackageVO packageVO : packages) {
142 Collection<EntityVO> entities = packageVO.getEntities();
143 for (final EntityVO entityVO : entities) {
144 fqns.add(MessageFormat.format(pattern, packageVO.getName(), entityVO.getName()));
145 }
146 }
147 }
148
149 }