PageRenderTime 26ms CodeModel.GetById 12ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 1ms

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

https://bitbucket.org/mmeinhold/amps
Java | 58 lines | 43 code | 12 blank | 3 comment | 0 complexity | 1f2a52472a2bd75d35145794348b231c MD5 | raw file
 1package com.atlassian.plugins.codegen.modules.jira;
 2
 3import com.atlassian.plugins.codegen.ClassId;
 4import com.atlassian.plugins.codegen.modules.BasicClassModuleProperties;
 5
 6import org.apache.commons.lang.StringUtils;
 7
 8import static com.atlassian.plugins.codegen.ClassId.fullyQualified;
 9
10/**
11 * @since 3.6
12 */
13public class WorkflowElementProperties extends BasicClassModuleProperties
14{
15    public static final String FQ_FACTORY_NAME = "FQ_FACTORY_NAME";
16    public static final String FACTORY_NAME = "FACTORY_NAME";
17
18    private ClassId factoryClassId;
19    
20    public WorkflowElementProperties()
21    {
22        this("MyWorkflowElement");
23    }
24
25    public WorkflowElementProperties(String fqClassName)
26    {
27        super(fqClassName);
28    }
29
30    @Override
31    public void setFullyQualifiedClassname(String fqName)
32    {
33        super.setFullyQualifiedClassname(fqName);
34        setFullyQualifiedFactoryName(fqName + "Factory");
35    }
36
37    public void setFullyQualifiedFactoryName(String fqName)
38    {
39        factoryClassId = fullyQualified(fqName);
40        setProperty(FQ_FACTORY_NAME, fqName);
41        setProperty(FACTORY_NAME, factoryClassId.getName());
42    }
43
44    public ClassId getFactoryClassId()
45    {
46        return factoryClassId;
47    }
48    
49    public String getFullyQualifiedFactoryName()
50    {
51        return factoryClassId.getFullName();
52    }
53
54    public String getFactoryName()
55    {
56        return factoryClassId.getName();
57    }
58}