if (mode == ParseMode.NAME) {
name = str;
}
else if (mode == ParseMode.IF) {
ifObj = unconditionalContext ? new If() : new If(str);
}
else if (qName.equals("predicate")) {
predicate = ifObj;
// predicateContext = false;
}
else if (mode.equals(ParseMode.THEN)) {
List<String> segmentList = new ArrayList<String>();
List<Boolean> markerList = new ArrayList<Boolean>();
findSegments(segmentList, markerList, str);
String[] segments = segmentList.toArray(new String[] {});
boolean[] markers = new boolean[markerList.size()];
for (ListIterator<Boolean> li = markerList.listIterator(); li.hasNext();) {
int idx = li.nextIndex();
markers[idx] = li.next();
}
Then thenObj = new Then(getLanguage(), segments, markers);
Condition cond;
if (unconditionalContext)
cond = new Condition(new If(), thenObj);
else
cond = new Condition(ifObj, thenObj);
conditions.add(cond);
}