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 private String errorText;
9
10 protected AbstractNoOpModuleDescriptor() {
11 super(new ModuleFactory() {
12 @Override
13 public <T> T createModule(String name, ModuleDescriptor<T> moduleDescriptor) throws PluginParseException {
14 throw new IllegalStateException("The module is either unloadable or unrecognised, in any case this shouldn't be called!");
15 }
16 });
17 }
18
19 public final String getErrorText() {
20 return errorText;
21 }
22
23 public final void setErrorText(final String errorText) {
24 this.errorText = errorText;
25 }
26
27 @Override
28 public final T getModule() {
29 return null;
30 }
31
32 @Override
33 public final boolean isEnabledByDefault() {
34 return false;
35 }
36
37
38
39
40
41
42
43
44
45 public final void setKey(final String key) {
46 this.key = key;
47 }
48
49
50
51
52
53
54
55
56
57 public final void setName(final String name) {
58 this.name = name;
59 }
60 }