/** * Returns the supported options set. * * @return the supported options set or empty set if none */ public final Set<String> getSupportedOptions() { SupportedOptions options = this.getClass().getAnnotation(SupportedOptions.class); if (options != null) { return new HashSet<>(Arrays.asList(options.value())); } return Collections.emptySet(); }
@Override public Set<String> getSupportedOptions() { Set<String> supportedOptions = new HashSet<>(); //Add global options SupportedOptions globalOptions = this.getClass().getAnnotation(SupportedOptions.class); if (globalOptions != null) { supportedOptions.addAll(Arrays.asList(globalOptions.value())); } //Add tool processors options for (AbstractGenerator generator : generators) { supportedOptions.addAll(generator.getSupportedOptions()); } return supportedOptions; }
/** * Add a {@link Plugin} class to the list of known plugins * * @param plugin the plugin class * @param priority the priority to give the plugin */ private void addPlugin(Class<? extends Plugin> plugin, PluginPriority priority) { switch (priority) { case LOW: lowPriorityPlugins.add(plugin); break; case HIGH: highPriorityPlugins.add(plugin); break; case NORMAL: default: normalPriorityPlugins.add(plugin); break; } SupportedOptions supportedOptionsAnnotation = plugin.getAnnotation(SupportedOptions.class); if (supportedOptionsAnnotation != null) { String[] options = supportedOptionsAnnotation.value(); Collections.addAll(pluginSupportedOptions, options); } }
/** * Returns the supported options set. * * @return the supported options set or empty set if none */ public final Set<String> getSupportedOptions() { SupportedOptions options = this.getClass().getAnnotation(SupportedOptions.class); if (options != null) { return new HashSet<String>(Arrays.asList(options.value())); } return Collections.emptySet(); }
/** * Returns the supported options set. * * @return the supported options set or empty set if none */ public final Set<String> getSupportedOptions() { SupportedOptions options = this.getClass().getAnnotation(SupportedOptions.class); if (options != null) { return new HashSet<String>(Arrays.asList(options.value())); } return Collections.emptySet(); }
@Override public Set<String> getSupportedOptions() { SupportedOptions so = this.getClass().getAnnotation(SupportedOptions.class); Set<String> result = new HashSet<String>(); if (so != null) { result = arrayToSet(so.value()); } result.add(CLASSPATH_OPTION); result.add(PROJECT_NAME_OPTION); result.add(TEST_CLASSPATH_OPTION); return result; }
@Override public Set<String> getSupportedOptions() { Set<String> supportedOptions = new HashSet<String>(); //Add global options SupportedOptions globalOptions = this.getClass().getAnnotation(SupportedOptions.class); if (globalOptions != null) { supportedOptions.addAll(Arrays.asList(globalOptions.value())); } //Add tool processors options for (AbstractGenerator generator : processors) { supportedOptions.addAll(generator.getSupportedOptions()); } return supportedOptions; }
/** * If the processor class is annotated with {@link * SupportedOptions}, return an unmodifiable set with the same set * of strings as the annotation. If the class is not so * annotated, an empty set is returned. * * @return the options recognized by this processor, or an empty * set if none */ public Set<String> getSupportedOptions() { SupportedOptions so = this.getClass().getAnnotation(SupportedOptions.class); if (so == null) return Collections.emptySet(); else return arrayToSet(so.value()); }
/** * If the processor class is annotated with {@link * SupportedOptions}, return an unmodifiable set with the same set * of strings as the annotation. If the class is not so * annotated, an empty set is returned. * * @return the options recognized by this processor, or an empty * set if none */ public Set<String> getSupportedOptions() { SupportedOptions so = this.getClass().getAnnotation(SupportedOptions.class); if (so == null) return Collections.emptySet(); else return arrayToSet(so.value()); }
/** * Add a {@link Plugin} class to the list of known plugins * * @param plugin the plugin class * @param priority the priority to give the plugin */ private void addPlugin(Class<? extends Plugin> plugin, PluginPriority priority) { switch (priority) { case LOW: lowPriorityPlugins.add(plugin); break; case HIGH: highPriorityPlugins.add(plugin); break; case NORMAL: default: normalPriorityPlugins.add(plugin); break; } SupportedOptions supportedOptionsAnnotation = plugin.getAnnotation(SupportedOptions.class); if (supportedOptionsAnnotation != null) { String[] options = supportedOptionsAnnotation.value(); Collections.addAll(pluginSupportedOptions, options); } }
/** * {@inheritDoc} */ @Override public Set<String> getSupportedOptions() { Set<String> supportedOptions = new HashSet<String>(); //Add global options SupportedOptions globalOptions = this.getClass().getAnnotation(SupportedOptions.class); if (globalOptions != null) { supportedOptions.addAll(Arrays.asList(globalOptions.value())); } //Add tool processors options for (AbstractTool generator : processors) { supportedOptions.addAll(generator.getSupportedOptions()); } return supportedOptions; }
/** * If the processor class is annotated with {@link * SupportedOptions}, return an unmodifiable set with the same set * of strings as the annotation. If the class is not so * annotated, an empty set is returned. * * @return the options recognized by this processor, or an empty * set if none */ public Set<String> getSupportedOptions() { SupportedOptions so = this.getClass().getAnnotation(SupportedOptions.class); if (so == null) return Collections.emptySet(); else return arrayToSet(so.value()); }
/** * If the processor class is annotated with {@link * SupportedOptions}, return an unmodifiable set with the same set * of strings as the annotation. If the class is not so * annotated, an empty set is returned. * * @return the options recognized by this processor, or an empty * set if none */ public Set<String> getSupportedOptions() { SupportedOptions so = this.getClass().getAnnotation(SupportedOptions.class); if (so == null) return Collections.emptySet(); else return arrayToSet(so.value()); }
/** * {@inheritDoc} */ @Override public Set<String> getSupportedOptions() { Set<String> supportedOptions = new HashSet<String>(); //Add global options SupportedOptions globalOptions = this.getClass().getAnnotation(SupportedOptions.class); if (globalOptions != null) { supportedOptions.addAll(Arrays.asList(globalOptions.value())); } //Add tool processors options for (AbstractTool generator : processors) { supportedOptions.addAll(generator.getSupportedOptions()); } return supportedOptions; }
@Pure @Override public @Capturable @Unmodifiable @Nonnull Set<@Nonnull String> getSupportedOptions() { final @Nullable SupportedOptions supportedOptions = getClass().getAnnotation(SupportedOptions.class); if (supportedOptions != null) { return convertArrayToUnmodifiableSet(supportedOptions.value()); } else { return Collections.emptySet(); } }