Package jfun.yan.xml.nut

Examples of jfun.yan.xml.nut.NutDescriptor


public class XFireLoader extends YanLoader {
  private final Object xfire_name;
  private static final NutIntrospector introspector = new NutIntrospector();
  protected void decorateProcessor(NutsProcessor processor, ServletContext ctxt) throws Exception {
    super.decorateProcessor(processor, ctxt);
    final NutDescriptor desc = introspector.getNutDescriptor(ServiceNut.class);
    desc.setFactory(new Factory(){
      public Object create(){
        return new ServiceNut(Components.useKey(xfire_name));
      }
    });
    processor.registerNut("service", desc);
View Full Code Here


              + " is of type "+Misc.getTypeName(type)
              +", not a subtype of Nut.");
        }*/
      }
      try{
        final NutDescriptor desc = introspector.getNutDescriptor(type);
        descs.put(key, desc);
      }
      catch(IntrospectionException e){
        throw new IllegalArgumentException("failed to introspect type "+Misc.getTypeName(type));
      }
View Full Code Here

    }
  }
  private synchronized void addNuts(Container nuts, Map descs){
    for(Iterator it=descs.keySet().iterator();it.hasNext();){
      final Object key = it.next();
      final NutDescriptor desc = (NutDescriptor)descs.get(key);
      final Factory factory = nuts.getFactory(key);
      desc.setFactory(factory);
      registerNut(key.toString(), desc);
    }
  }
View Full Code Here

      }
      else if(CALLCC.equals(name)){
        return compileCallcc(local_ctxt, nodes);
      }
      else{
        final NutDescriptor desc = (NutDescriptor)nut_descriptors.get(name);
        if(desc == null){
          throw raise("unknown nut");
        }
        return compileNut(name, desc, local_ctxt, nodes, false);
      }
View Full Code Here

      }
    }
    private void populateSubnutAdder(int seq, final NutDescriptor desc,
        Tag subtag, List mutations, Dict ctxt){
      final String subname = subtag.getName();
      NutDescriptor subdesc = desc.getSubDescriptor(subname);
      if(subdesc!=null){
        final NutDescriptor customized_desc =
          (NutDescriptor)nut_descriptors.get(subname);
        if(customized_desc!=null){
          if(subdesc.getType().isAssignableFrom(customized_desc.getType())){
            //we have a customized nut tag that's subtype.
            subdesc = customized_desc;
          }
        }
        final Stmt sub = new TagCompiler(seq, ctxt, subtag, null, false, false)
View Full Code Here

TOP

Related Classes of jfun.yan.xml.nut.NutDescriptor

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.