Package jfun.yan

Examples of jfun.yan.SimpleComponent


    return msg;
  }

  public Component eval(){
    checkMandatory("msg", msg);
    return new SimpleComponent(boolean.class){
      public Object create(){
        System.out.println(msg);
        return Boolean.valueOf(true);
      }
    };
View Full Code Here


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

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

  }

  public Component eval(){
    final List keys = getKeys();
    final Component[] vals = getEntryComponents();
    final Component step1 = new SimpleComponent(Properties.class){
      public Object create(){
        return new Properties();
      }
    };
    return Components.storeMap(step1, keys.toArray(), vals);
View Full Code Here

  public Component eval(){
    final Component[] elements = getMandatoryElements();
    final Class type = getType(Object[].class);
    final Class oftype = getOf();
    final Class etype = oftype==null?Object.class:oftype;
    final Component step1 = new SimpleComponent(type){
      public Object create(){
        return Array.newInstance(etype, elements.length);
      }
      public String toString(){
        return StringUtils.listArray("[",",","]",elements);
View Full Code Here

    }
  }
  public Component eval(){
    final Component[] elements = getMandatoryElements();
    final Class ltype = getType(HashSet.class);
    final Component step1 = new SimpleComponent(ltype){
      public Object create(){
        return createSet(elements.length);
      }
      public String toString(){
        return "set"+StringUtils.listArray("[",",","]",elements);
View Full Code Here

    }
  }
  public Component eval(){
    final Component[] elements = getMandatoryElements();
    final Class ltype = getType(ArrayList.class);
    final Component step1 = new SimpleComponent(ltype){
      public Object create(){
        return createList(elements.length);
      }
      public String toString(){
        return "list"+StringUtils.listArray("[",",","]",elements);
View Full Code Here

  public Component eval(){
    checkMandatory("map type", type);
    final List keys = getKeys();
    final int sz = keys.size();
    final Component[] vals = getEntryComponents();
    final Component step1 = new SimpleComponent(type){
      public Object create(){
        return createMap(sz);
      }
    };
    return Components.storeMap(step1, keys.toArray(), vals);
View Full Code Here

    this.name = name;
  }

  public Object call(Object[] args) {
    final Object result = args[0];
    return new SimpleComponent(null){
      public Object create(){
        throw getContinuation(id, result);
      }
      public String toString(){
        return name + " " + result;
View Full Code Here

TOP

Related Classes of jfun.yan.SimpleComponent

Copyright © 2018 www.massapicom. 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.