package jfun.yan.xml.nuts.optional;
import jfun.yan.Component;
import jfun.yan.SimpleComponent;
import jfun.yan.xml.nut.ComponentNut;
/**
* A Nut class that prints a message to the standard output
* when evaluated.
* <p>
* @author Ben Yu
* Nov 10, 2005 12:07:50 AM
*/
public class PrintNut extends ComponentNut {
private Object msg;
public void setMsg(Object msg) {
this.msg = msg;
}
public Object getMsg() {
return msg;
}
public Component eval(){
checkMandatory("msg", msg);
return new SimpleComponent(boolean.class){
public Object create(){
System.out.println(msg);
return Boolean.valueOf(true);
}
};
}
}