View Javadoc

1   package com.atlassian.plugins.rest.module.expand.resolver;
2   
3   import com.atlassian.plugin.AutowireCapablePlugin;
4   import com.atlassian.plugins.rest.common.expand.EntityExpander;
5   import com.atlassian.plugins.rest.common.expand.Expander;
6   import com.atlassian.plugins.rest.common.expand.resolver.AbstractAnnotationEntityExpanderResolver;
7   
8   import static com.google.common.base.Preconditions.checkNotNull;
9   
10  public class PluginEntityExpanderResolver extends AbstractAnnotationEntityExpanderResolver
11  {
12      private final AutowireCapablePlugin plugin;
13  
14      public PluginEntityExpanderResolver(AutowireCapablePlugin plugin)
15      {
16          this.plugin = checkNotNull(plugin);
17      }
18  
19      protected final EntityExpander<?> getEntityExpander(Expander expander)
20      {
21          return plugin.autowire(expander.value());
22      }
23  }