コード例 #1
0
ファイル: DSLTree.java プロジェクト: rikjbpm/droolsjbpm-tools
 /**
  * method will strip out the when, then, * at the beginning of each line and the mapped drl
  * expression
  *
  * @param text
  * @return
  */
 protected String stripHeadingAndCode(String text) {
   if (text.startsWith(DSLMappingEntry.CONDITION.getSymbol())) {
     return text.substring(DSLMappingEntry.CONDITION.getSymbol().length() + 2, text.indexOf("="));
   } else if (text.startsWith(DSLMappingEntry.CONSEQUENCE.getSymbol())) {
     return text.substring(
         DSLMappingEntry.CONSEQUENCE.getSymbol().length() + 2, text.indexOf("="));
   } else if (text.startsWith(DSLMappingEntry.ANY.getSymbol())) {
     return text.substring(DSLMappingEntry.ANY.getSymbol().length() + 2, text.indexOf("="));
   } else if (text.startsWith("#")) {
     return "";
   } else {
     return text;
   }
 }
コード例 #2
0
ファイル: DSLTree.java プロジェクト: rikjbpm/droolsjbpm-tools
 protected Section getSection(String text) {
   if (text.startsWith(DSLMappingEntry.CONDITION.getSymbol())) {
     return DSLMappingEntry.CONDITION;
   } else if (text.startsWith(DSLMappingEntry.CONSEQUENCE.getSymbol())) {
     return DSLMappingEntry.CONSEQUENCE;
   } else if (text.startsWith(DSLMappingEntry.ANY.getSymbol())) {
     return DSLMappingEntry.ANY;
   } else if (text.startsWith(DSLMappingEntry.KEYWORD.getSymbol())) {
     return DSLMappingEntry.KEYWORD;
   }
   return null;
 }