1 package com.atlassian.plugin.descriptors;
2
3 import com.atlassian.plugin.ModuleDescriptor;
4 import com.atlassian.plugin.PluginParseException;
5 import com.atlassian.plugin.module.ModuleFactory;
6
7 abstract class AbstractNoOpModuleDescriptor<T> extends AbstractModuleDescriptor<T>
8 {
9 private String errorText;
10
11 protected AbstractNoOpModuleDescriptor()
12 {
13 super(new ModuleFactory()
14 {
15 @Override
16 public <T> T createModule(String name, ModuleDescriptor<T> moduleDescriptor) throws PluginParseException
17 {
18 throw new IllegalStateException("The module is either unloadable or unrecognised, in any case this shouldn't be called!");
19 }
20 });
21 }
22
23 public final String getErrorText()
24 {
25 return errorText;
26 }
27
28 public final void setErrorText(final String errorText)
29 {
30 this.errorText = errorText;
31 }
32
33 @Override
34 public final T getModule()
35 {
36 return null;
37 }
38
39 @Override
40 public final boolean isEnabledByDefault()
41 {
42 return false;
43 }
44
45
46
47
48
49
50
51
52
53 public final void setKey(final String key)
54 {
55 this.key = key;
56 }
57
58
59
60
61
62
63
64
65
66 public final void setName(final String name)
67 {
68 this.name = name;
69 }
70 }