166 boolean isRoot() {
167 return "root".equals(id);
168 }
169
170 String getCLDRPath() {
171 return cldrPath;
172 }
173
174 EnumSet<Type> getBundleTypes() {
175 return bundleTypes;
176 }
177
178 String getCurrencies() {
179 return currencies;
180 }
181
182 /**
183 * Generate a map that contains all the data that should be
184 * visible for the bundle's locale
185 */
186 Map<String, Object> getTargetMap() throws Exception {
187 if (targetMap != null) {
188 return targetMap;
189 }
190
191 String[] cldrBundles = getCLDRPath().split(",");
192
193 // myMap contains resources for id.
194 Map<String, Object> myMap = new HashMap<>();
195 int index;
196 for (index = 0; index < cldrBundles.length; index++) {
197 if (cldrBundles[index].equals(id)) {
198 myMap.putAll(CLDRConverter.getCLDRBundle(cldrBundles[index]));
199 break;
200 }
201 }
202
203 // parentsMap contains resources from id's parents.
204 Map<String, Object> parentsMap = new HashMap<>();
205 for (int i = cldrBundles.length - 1; i > index; i--) {
|
166 boolean isRoot() {
167 return "root".equals(id);
168 }
169
170 String getCLDRPath() {
171 return cldrPath;
172 }
173
174 EnumSet<Type> getBundleTypes() {
175 return bundleTypes;
176 }
177
178 String getCurrencies() {
179 return currencies;
180 }
181
182 /**
183 * Generate a map that contains all the data that should be
184 * visible for the bundle's locale
185 */
186 @SuppressWarnings("unchecked")
187 Map<String, Object> getTargetMap() throws Exception {
188 if (targetMap != null) {
189 return targetMap;
190 }
191
192 String[] cldrBundles = getCLDRPath().split(",");
193
194 // myMap contains resources for id.
195 Map<String, Object> myMap = new HashMap<>();
196 int index;
197 for (index = 0; index < cldrBundles.length; index++) {
198 if (cldrBundles[index].equals(id)) {
199 myMap.putAll(CLDRConverter.getCLDRBundle(cldrBundles[index]));
200 break;
201 }
202 }
203
204 // parentsMap contains resources from id's parents.
205 Map<String, Object> parentsMap = new HashMap<>();
206 for (int i = cldrBundles.length - 1; i > index; i--) {
|