1   package com.atlassian.plugins.codegen.modules.confluence.blueprint;
2   
3   /**
4    * Creates strings for the {@link BlueprintBuilder} by convention. This class is separate to the generator class to
5    * provide a single point of change if we alter the naming conventions.
6    *
7    * @since 4.1.8
8    */
9   public class BlueprintStringer
10  {
11      private final String indexKey;
12      private final String pluginKey;
13  
14      public BlueprintStringer(String indexKey, String pluginKey)
15      {
16          this.indexKey = indexKey;
17          this.pluginKey = pluginKey;
18      }
19  
20      public String makeBlueprintModuleKey()
21      {
22          return indexKey + "-blueprint";
23      }
24  
25      public String makeContentTemplateKey(int templateIndex)
26      {
27          String key = indexKey + "-template";
28          if (templateIndex > 0)
29          {
30              key += "-" + templateIndex;
31          }
32          return key;
33      }
34  
35      public String makeBlueprintModuleName(String blueprintName)
36      {
37          return blueprintName + " Blueprint";
38      }
39  
40      public String makeSoyTemplatePackage(String blueprintName)
41      {
42          return "Confluence.Blueprints.Plugin." + blueprintName.replaceAll("\\W", "");
43      }
44  
45      public String makeContentTemplateName(String webItemName, int counter)
46      {
47          return webItemName + " Content Template " + counter;
48      }
49  
50      public String makeI18nKey(String suffix)
51      {
52          return pluginKey + "." + suffix;
53      }
54  }