1 package com.atlassian.plugins.rest.module.expand.resolver;
2
3 import com.atlassian.plugin.osgi.factory.OsgiPlugin;
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 import static com.google.common.base.Preconditions.*;
8
9 public class OsgiPluginEntityExpanderResolver extends AbstractAnnotationEntityExpanderResolver
10 {
11 private final OsgiPlugin plugin;
12
13 public OsgiPluginEntityExpanderResolver(OsgiPlugin plugin)
14 {
15 this.plugin = checkNotNull(plugin);
16 }
17
18 protected final EntityExpander<?> getEntityExpander(Expander expander)
19 {
20 return plugin.autowire(expander.value());
21 }
22 }