public String getCriterionName(String id, String locale) {
   ICriteriaDefinition definition = getCriteriaDefinition(locale);
   ICriterionDefinition[] criterionDefinitions = definition.getCriterionDefinitions();
   for (int i = 0; i < criterionDefinitions.length; i++) {
     CriterionDefinition criterionDefinition = (CriterionDefinition) criterionDefinitions[i];
     if (null != criterionDefinition.getId() && criterionDefinition.getId().equalsIgnoreCase(id)) {
       String name = criterionDefinition.getName();
       if (null != name && 0 != name.length()) {
         return name;
       }
     }
   }
   return id;
 }
 public String getCriterionValueName(String criterionId, String criterionValueId, String locale) {
   ICriteriaDefinition definition = getCriteriaDefinition(locale);
   ICriterionDefinition[] criterionDefinitions = definition.getCriterionDefinitions();
   for (int i = 0; i < criterionDefinitions.length; ++i) {
     CriterionDefinition criterionDefinition = (CriterionDefinition) criterionDefinitions[i];
     if (null != criterionDefinition.getId()
         && criterionDefinition.getId().equalsIgnoreCase(criterionId)) {
       ICriterionValueDefinition[] valueDefinitions =
           criterionDefinition.getCriterionValueDefinitions();
       for (int j = 0; j < valueDefinitions.length; ++j) {
         CriterionValueDefinition valueDefinition = (CriterionValueDefinition) valueDefinitions[j];
         if (null != valueDefinition.getId() && valueDefinition.getId().equals(criterionValueId)) {
           String name = valueDefinition.getName();
           if (null != name && 0 != name.length()) {
             return name;
           }
         }
       }
     }
   }
   return criterionValueId;
 }