1 package com.atlassian.plugins.codegen.modules.common;
2
3 import com.atlassian.plugins.codegen.modules.AbstractClassBasedModuleProperties;
4
5
6
7
8 public class TemplateContextItemProperties extends AbstractClassBasedModuleProperties
9 {
10 public static final String CONTEXT_KEY = "CONTEXT_KEY";
11 public static final String COMPONENT_REF = "COMPONENT_REF";
12 public static final String GLOBAL = "GLOBAL";
13
14 public TemplateContextItemProperties()
15 {
16 this("My Template Context Item");
17 }
18
19 public TemplateContextItemProperties(String moduleName)
20 {
21 super();
22 setModuleNameAndKey(moduleName);
23 setGlobal(false);
24 }
25
26 public TemplateContextItemProperties(String moduleName, String contextKey)
27 {
28 this(moduleName);
29 setContextKey(contextKey);
30 }
31
32 public void setContextKey(String key)
33 {
34 setProperty(CONTEXT_KEY, key);
35 }
36
37 public String getContextKey()
38 {
39 return getProperty(CONTEXT_KEY);
40 }
41
42 public void setComponentRef(String ref)
43 {
44 setProperty(COMPONENT_REF, ref);
45 }
46
47 public String getComponentRef()
48 {
49 return getProperty(COMPONENT_REF);
50 }
51
52 public void setGlobal(boolean global)
53 {
54 setProperty(GLOBAL, Boolean.toString(global));
55 }
56
57 public boolean isGlobal()
58 {
59 return Boolean.valueOf(getProperty(GLOBAL));
60 }
61 }