/* ************************************************************************
#
#  DivConq
#
#  http://divconq.com/
#
#  Copyright:
#    Copyright 2012 eTimeline, LLC. All rights reserved.
#
#  License:
#    See the license.txt file in the project's top-level directory for details.
#
#  Authors:
#    * Andy White
#
************************************************************************ */
package divconq.script.mutator;

import divconq.script.Activity;
import divconq.script.IMutator;
import divconq.script.StackEntry;
import divconq.struct.Struct;
import divconq.xml.XElement;

public class ValidateMutator implements IMutator {
	@Override
	public void mutate(Activity activity, StackEntry stack, XElement code, Struct dest) {
		if (dest == null) {
			// TODO log
			return;
		}

		// TODO need some way to set a variable with the result, not just using _LastResult
		//stack.queryVariable(name)
		
		stack.setLastResult(dest.validate());
	}
}
