Version 4 (modified by fbatard, 5 years ago)

--

Code and Code again :)




How to simplify that?

	private TLTNode FillNode(ElseType myElse) {
		TLTNode node=new TLTNode();
		for(ExecType exec : myElse.getExecArray()){
			node.addExec(new TLTExec(exec.getId(),exec.getValue(),exec.getParam()));
		}
		for(IfType iflist : myElse.getIfArray()){
			node.addIf(fillIfs(iflist));
		}
		return node;
	}
	
	private TLTNode FillNode(ThenType myThen) {
		TLTNode node=new TLTNode();
		for(ExecType exec : myThen.getExecArray()){
			node.addExec(new TLTExec(exec.getId(),exec.getValue(),exec.getParam()));
		}
		for(IfType iflist : myThen.getIfArray()){
			node.addIf(fillIfs(iflist));
		}
		return node;
	}

The difference is only in the parameter.. Parameters are auto-generated types created by XMLBeans so we can't change it...


I'm coding the relation between the if value attributes and the conds nodes.
As we build the tree we have insert the cond in it and therefore we'll have to find the cond node by ourselves. I'll try XMLCursor for that.

Attachments