Package jfun.yan.xml.nuts.optional

Source Code of jfun.yan.xml.nuts.optional.FailNut

package jfun.yan.xml.nuts.optional;

import jfun.yan.Component;
import jfun.yan.SimpleComponent;
import jfun.yan.xml.nut.ComponentNut;

/**
* A tag that reports error message.
* <p>
* @author Ben Yu
* Nov 11, 2005 3:44:10 PM
*/
public class FailNut extends ComponentNut {
  private String msg;
 
  public String getMsg() {
    return msg;
  }

  public void setMsg(String msg) {
    this.msg = msg;
  }

  public Component eval(){
    return new SimpleComponent(void.class){
      public Object create(){
        throw raise(msg);
      }
    };
  }

}
TOP

Related Classes of jfun.yan.xml.nuts.optional.FailNut

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.