if (reader.getNodeName().equalsIgnoreCase("conditions")) {
while (reader.hasMoreChildren()) {
//read a single condition
reader.moveDown(); //move down to condition
reader.moveDown(); //move down to target
Condition condition = new Condition();
condition.setTarget(reader.getValue().trim());
reader.moveUp(); //move up to condition
//parse statement
ArrayList<String> statementValues = new ArrayList<String>();
reader.moveDown(); //move down to statement
while (reader.hasMoreChildren()) { //childs of statement (logical, attribute, ...)
reader.moveDown(); //move down to statement property
System.out.println(" " + reader.getValue().trim());
statementValues.add(reader.getValue());
reader.moveUp(); //move up to statement
}
reader.moveUp();//move up to condition
Statement stm = new Statement();
stm.create(statementValues.get(0),
statementValues.get(1),
statementValues.get(2),
statementValues.get(3));
condition.setStatement(stm);
conditions.add(condition);
reader.moveUp(); //move up to conditions
}
reader.moveUp(); //move up to root
reader.moveDown();//move down to sequence