예제 #1
0
 /**
  * Translates a comp system name (from e.g. an action or a parameter) to how it shall be used in
  * api
  *
  * @param name original name
  * @return the name which should be used in api
  */
 public String translateFromCompSystem(String name) {
   String desiredName = CompSystemI18n.getString(name);
   desiredName =
       desiredName
           .replace(StringConstants.MINUS, StringConstants.SPACE)
           .replace(StringConstants.LEFT_PARENTHESES, StringConstants.SPACE)
           .replace(StringConstants.RIGHT_PARENTHESES, StringConstants.SPACE)
           .replace(StringConstants.SLASH, StringConstants.SPACE);
   desiredName = WordUtils.capitalize(desiredName);
   desiredName = StringUtils.deleteWhitespace(desiredName);
   desiredName = WordUtils.uncapitalize(desiredName);
   return desiredName;
 }
예제 #2
0
 /**
  * Translates a component name from the comp system to how it shall be used in the api
  *
  * @param name the class name in comp system
  * @return the name of the class in the api
  */
 public String getClassName(String name) {
   String desiredName = CompSystemI18n.getString(name);
   desiredName = desiredName.replace(StringConstants.SLASH, StringConstants.SPACE);
   if (desiredName.startsWith(StringConstants.LEFT_PARENTHESES)) {
     desiredName = StringUtils.substringAfter(desiredName, StringConstants.RIGHT_PARENTHESES);
   }
   desiredName =
       desiredName
           .replace(StringConstants.LEFT_PARENTHESES, StringConstants.SPACE)
           .replace(StringConstants.RIGHT_PARENTHESES, StringConstants.SPACE);
   desiredName = WordUtils.capitalize(desiredName);
   desiredName = StringUtils.deleteWhitespace(desiredName);
   return desiredName;
 }