256 return true;
257 }
258
259 @Override
260 public String getArgumentsDescription() {
261 return PluginsResourceBundle.getArgument(NAME);
262 }
263
264 @Override
265 public void configure(Map<String, String> config) {
266 String strategies = config.get(NAME);
267 String[] arr = strategies.split(",");
268 for (String s : arr) {
269 if (s.equals(ALL)) {
270 optimizers.clear();
271 optimizers.add(new ForNameFolding());
272 break;
273 } else if (s.equals(FORNAME_REMOVAL)) {
274 optimizers.add(new ForNameFolding());
275 } else {
276 throw new PluginException("Unknown optimization");
277 }
278 }
279 String f = config.get(LOG);
280 if (f != null) {
281 try {
282 stream = new FileOutputStream(f);
283 } catch (IOException ex) {
284 throw new UncheckedIOException(ex);
285 }
286 }
287 }
288
289 @Override
290 public Set<PluginType> getType() {
291 Set<PluginType> set = new HashSet<>();
292 set.add(CATEGORY.TRANSFORMER);
293 return Collections.unmodifiableSet(set);
294 }
295 }
|
256 return true;
257 }
258
259 @Override
260 public String getArgumentsDescription() {
261 return PluginsResourceBundle.getArgument(NAME);
262 }
263
264 @Override
265 public void configure(Map<String, String> config) {
266 String strategies = config.get(NAME);
267 String[] arr = strategies.split(",");
268 for (String s : arr) {
269 if (s.equals(ALL)) {
270 optimizers.clear();
271 optimizers.add(new ForNameFolding());
272 break;
273 } else if (s.equals(FORNAME_REMOVAL)) {
274 optimizers.add(new ForNameFolding());
275 } else {
276 throw new IllegalArgumentException("Unknown optimization: " + s);
277 }
278 }
279 String f = config.get(LOG);
280 if (f != null) {
281 try {
282 stream = new FileOutputStream(f);
283 } catch (IOException ex) {
284 throw new UncheckedIOException(ex);
285 }
286 }
287 }
288
289 @Override
290 public Set<PluginType> getType() {
291 Set<PluginType> set = new HashSet<>();
292 set.add(CATEGORY.TRANSFORMER);
293 return Collections.unmodifiableSet(set);
294 }
295 }
|