PageRenderTime 42ms CodeModel.GetById 33ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/plugin-module-codegen-engine/src/main/java/com/atlassian/plugins/codegen/modules/BasicClassModuleProperties.java

https://bitbucket.org/mmeinhold/amps
Java | 40 lines | 30 code | 7 blank | 3 comment | 0 complexity | e355647adac4f50c5e731a8995d24a67 MD5 | raw file
 1package com.atlassian.plugins.codegen.modules;
 2
 3import com.atlassian.plugins.codegen.ClassId;
 4import com.atlassian.plugins.codegen.util.ClassnameUtil;
 5
 6/**
 7 *
 8 */
 9public class BasicClassModuleProperties extends AbstractClassBasedModuleProperties
10{   
11    public BasicClassModuleProperties()
12    {
13        this("MyPluginModule");
14    }
15
16    protected BasicClassModuleProperties(BasicClassModuleProperties from, ClassId newClass)
17    {
18        super(from, newClass);
19    }
20
21    public BasicClassModuleProperties(String fqClassName)
22    {
23        super();
24
25        setFullyQualifiedClassname(fqClassName);
26
27        String classname = getProperty(CLASSNAME);
28        setModuleName(ClassnameUtil.camelCaseToSpaced(classname));
29        setModuleKey(ClassnameUtil.camelCaseToDashed(classname)
30                .toLowerCase());
31        setDescription("The " + getProperty(MODULE_NAME) + " Plugin");
32        setNameI18nKey(getProperty(MODULE_KEY) + ".name");
33        setDescriptionI18nKey(getProperty(MODULE_KEY) + ".description");
34    }
35
36    public ClassBasedModuleProperties withClass(ClassId newClass)
37    {
38        return new BasicClassModuleProperties(this, newClass);
39    }
40}