1 package com.atlassian.plugins.codegen.modules.jira;
2
3 import com.atlassian.plugins.codegen.modules.ClassWithInterfaceProperties;
4 import com.atlassian.plugins.codegen.util.ClassnameUtil;
5
6
7
8
9 public class RPCProperties extends ClassWithInterfaceProperties
10 {
11
12 public static final String SERVICE_PATH = "SERVICE_PATH";
13 private boolean soap;
14
15 public RPCProperties()
16 {
17 this("My RPC");
18 }
19
20 public RPCProperties(String fqClassName)
21 {
22 super();
23 setSoap(true);
24
25 setFullyQualifiedInterface(fqClassName);
26 setFullyQualifiedClassname(fqClassName + "Impl");
27
28 String classname = getProperty(INTERFACE_CLASS);
29 setModuleName(ClassnameUtil.camelCaseToSpaced(classname));
30 setModuleKey(ClassnameUtil.camelCaseToDashed(classname)
31 .toLowerCase());
32 setDescription("The " + getProperty(MODULE_NAME) + " Plugin");
33 setNameI18nKey(getProperty(MODULE_KEY) + ".name");
34 setDescriptionI18nKey(getProperty(MODULE_KEY) + ".description");
35
36 setServicePath(getInterfaceClass().toLowerCase() + "-v1");
37 }
38
39 public RPCProperties(String fqClassName, String servicePath)
40 {
41 this(fqClassName);
42 setServicePath(servicePath);
43 }
44
45 public String getServicePath()
46 {
47 return getProperty(SERVICE_PATH);
48 }
49
50 public void setServicePath(String path)
51 {
52 setProperty(SERVICE_PATH, path);
53 }
54
55 public boolean isSoap()
56 {
57 return soap;
58 }
59
60 public void setSoap(boolean soap)
61 {
62 this.soap = soap;
63 }
64 }