[forge-issues] [JBoss JIRA] (FORGE-136) SPI to add @Option Converters for custom types
Lincoln Baxter III (JIRA)
jira-events at lists.jboss.org
Wed Apr 3 22:48:42 EDT 2013
[ https://issues.jboss.org/browse/FORGE-136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lincoln Baxter III closed FORGE-136.
------------------------------------
Assignee: Lincoln Baxter III
Resolution: Done
Implemented with Convert Addon in Forge 2
> SPI to add @Option Converters for custom types
> ----------------------------------------------
>
> Key: FORGE-136
> URL: https://issues.jboss.org/browse/FORGE-136
> Project: Forge
> Issue Type: Enhancement
> Components: Plugin API, UI - Shell
> Affects Versions: 1.0.0.Alpha2
> Reporter: Lincoln Baxter III
> Assignee: Lincoln Baxter III
> Fix For: 2.0.0.Alpha2
>
>
> This process should be encapsulated with a Forge interface API, adapter, and ServiceLoader for extension.
> {code}
> void init(@Observes final Startup event, final PluginCommandCompleter pluginCompleter) throws Exception
> {
> BooleanConverter booleanConverter = new BooleanConverter();
> addConversionHandler(boolean.class, booleanConverter);
> addConversionHandler(Boolean.class, booleanConverter);
> addConversionHandler(File.class, new FileConverter());
> addConversionHandler(Dependency.class, new DependencyIdConverter());
> addConversionHandler(URL.class, new URLConverter());
> ...
> }
> public interface OptionValueConverter<T> {
> public boolean supports(Class<?> type);
> public T convert(Object value);
> }
> {code}
> This interface should support injection.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the forge-issues
mailing list