View Javadoc

1   package com.atlassian.plugin.impl;
2   
3   import com.atlassian.plugin.Plugin;
4   import com.atlassian.plugin.ModuleDescriptor;
5   import com.atlassian.plugin.PluginInformation;
6   import com.atlassian.plugin.Resourced;
7   import com.atlassian.plugin.PluginState;
8   import com.atlassian.plugin.elements.ResourceDescriptor;
9   import com.atlassian.plugin.elements.ResourceLocation;
10  
11  import java.util.Collection;
12  import java.util.List;
13  import java.util.Date;
14  import java.util.Set;
15  import java.net.URL;
16  import java.io.InputStream;
17  
18  import org.apache.commons.lang.Validate;
19  
20  /**
21   * Delegating plugin that supports easy wrapping
22   *
23   * @since 2.2.0
24   */
25  public abstract class AbstractDelegatingPlugin implements Plugin, Comparable<Plugin>
26  {
27      private final Plugin delegate;
28  
29      public AbstractDelegatingPlugin(Plugin delegate)
30      {
31          Validate.notNull(delegate);
32          this.delegate = delegate;
33      }
34  
35      public int getPluginsVersion()
36      {
37          return delegate.getPluginsVersion();
38      }
39  
40      public void setPluginsVersion(int version)
41      {
42          delegate.setPluginsVersion(version);
43      }
44  
45      public String getName()
46      {
47          return delegate.getName();
48      }
49  
50      public void setName(String name)
51      {
52          delegate.setName(name);
53      }
54  
55      public String getI18nNameKey()
56      {
57          return delegate.getI18nNameKey();
58      }
59  
60      public void setI18nNameKey(String i18nNameKey)
61      {
62          delegate.setI18nNameKey(i18nNameKey);
63      }
64  
65      public String getKey()
66      {
67          return delegate.getKey();
68      }
69  
70      public void setKey(String aPackage)
71      {
72          delegate.setKey(aPackage);
73      }
74  
75      public void addModuleDescriptor(ModuleDescriptor<?> moduleDescriptor)
76      {
77          delegate.addModuleDescriptor(moduleDescriptor);
78      }
79  
80      public Collection<ModuleDescriptor<?>> getModuleDescriptors()
81      {
82          return delegate.getModuleDescriptors();
83      }
84  
85      public ModuleDescriptor<?> getModuleDescriptor(String key)
86      {
87          return delegate.getModuleDescriptor(key);
88      }
89  
90      public <M> List<ModuleDescriptor<M>> getModuleDescriptorsByModuleClass(Class<M> moduleClass)
91      {
92          return delegate.getModuleDescriptorsByModuleClass(moduleClass);
93      }
94  
95      public boolean isEnabledByDefault()
96      {
97          return delegate.isEnabledByDefault();
98      }
99  
100     public void setEnabledByDefault(boolean enabledByDefault)
101     {
102         delegate.setEnabledByDefault(enabledByDefault);
103     }
104 
105     public PluginInformation getPluginInformation()
106     {
107         return delegate.getPluginInformation();
108     }
109 
110     public void setPluginInformation(PluginInformation pluginInformation)
111     {
112         delegate.setPluginInformation(pluginInformation);
113     }
114 
115     public void setResources(Resourced resources)
116     {
117         delegate.setResources(resources);
118     }
119 
120     public PluginState getPluginState()
121     {
122         return delegate.getPluginState();
123     }
124 
125     public boolean isEnabled()
126     {
127         return delegate.isEnabled();
128     }
129 
130     public boolean isSystemPlugin()
131     {
132         return delegate.isSystemPlugin();
133     }
134 
135     public boolean containsSystemModule()
136     {
137         return delegate.containsSystemModule();
138     }
139 
140     public void setSystemPlugin(boolean system)
141     {
142         delegate.setSystemPlugin(system);
143     }
144 
145     public boolean isBundledPlugin()
146     {
147         return delegate.isBundledPlugin();
148     }
149 
150     public Date getDateLoaded()
151     {
152         return delegate.getDateLoaded();
153     }
154 
155     public boolean isUninstallable()
156     {
157         return delegate.isUninstallable();
158     }
159 
160     public boolean isDeleteable()
161     {
162         return delegate.isDeleteable();
163     }
164 
165     public boolean isDynamicallyLoaded()
166     {
167         return delegate.isDynamicallyLoaded();
168     }
169 
170     public <T> Class<T> loadClass(String clazz, Class<?> callingClass) throws ClassNotFoundException
171     {
172         return delegate.loadClass(clazz, callingClass);
173     }
174 
175     public ClassLoader getClassLoader()
176     {
177         return delegate.getClassLoader();
178     }
179 
180     public URL getResource(String path)
181     {
182         return delegate.getResource(path);
183     }
184 
185     public InputStream getResourceAsStream(String name)
186     {
187         return delegate.getResourceAsStream(name);
188     }
189 
190     public void setEnabled(boolean enabled)
191     {
192         delegate.setEnabled(enabled);
193     }
194 
195     public void close()
196     {
197         delegate.close();
198     }
199 
200     public void install()
201     {
202         delegate.install();
203     }
204 
205     public void uninstall()
206     {
207         delegate.uninstall();
208     }
209 
210     public void enable()
211     {
212         delegate.enable();
213     }
214 
215     public void disable()
216     {
217         delegate.disable();
218     }
219 
220     public Set<String> getRequiredPlugins()
221     {
222         return delegate.getRequiredPlugins();
223     }
224 
225     public List<ResourceDescriptor> getResourceDescriptors()
226     {
227         return delegate.getResourceDescriptors();
228     }
229 
230     public List<ResourceDescriptor> getResourceDescriptors(String type)
231     {
232         return delegate.getResourceDescriptors(type);
233     }
234 
235     public ResourceDescriptor getResourceDescriptor(String type, String name)
236     {
237         return delegate.getResourceDescriptor(type, name);
238     }
239 
240     public ResourceLocation getResourceLocation(String type, String name)
241     {
242         return delegate.getResourceLocation(type, name);
243     }
244 
245     public int compareTo(Plugin o)
246     {
247         return delegate.compareTo(o);
248     }
249 
250     public Plugin getDelegate()
251     {
252         return delegate;
253     }
254 }