Package jfun.yan.xml.nuts

Source Code of jfun.yan.xml.nuts.ProxyNut

package jfun.yan.xml.nuts;

import jfun.yan.Component;
/**
* Nut class for <proxy> tag.
* <p>
* @author Ben Yu
* Nov 9, 2005 11:42:15 PM
*/
public class ProxyNut extends DelegatingNut {
  private Class[] itfs;
  public void setType(Class type){
    checkDuplicate("types", itfs);
    itfs = new Class[]{type};
  }
  public void setInterfaces(Class[] types){
    checkDuplicate("type", itfs);
    this.itfs = types;
  }
  public Component eval(){
    final Component cc = getComponent();
    checkMandatory("component", cc);
    if(itfs!=null)
      return cc.proxy(itfs);
    else
      return cc.proxy();
  }
}
TOP

Related Classes of jfun.yan.xml.nuts.ProxyNut

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.