Пример #1
0
 private boolean ifCondition(String str) throws DefinedException {
   List<String> conList = re.getIfCondition(str);
   List<Boolean> temp = new ArrayList<Boolean>();
   List<String> conditions = new ArrayList<String>();
   for (String con : conList) {
     String condition = this.ifParameter(con);
     conditions.add(condition);
     List<String> pName = re.parameterName(condition);
     String determine = re.getDetermine(condition);
     boolean b;
     try {
       b = pName.get(0).equals(pName.get(1));
     } catch (Exception e) {
       throw new DefinedException("if title error, miss condition parameter!");
     }
     if (determine.equals(Keyword.getKeyword("equals"))) temp.add(b);
     if (determine.equals(Keyword.getKeyword("notEquals"))) temp.add(!b);
   }
   str = re.replaceIfCondition(str, conditions);
   Log.commentStep(str);
   if (temp.size() == 0)
     throw new DefinedException(str + " if title error, miss condition parameter!");
   return this.logicConnector(str, temp);
 }