Package railo.runtime

Examples of railo.runtime.ComponentWrap


 

  protected ASObject toAMFObject(Component cfc) throws PageException {
    // add properties
    ASObject aso = doProperties?super.toAMFObject(cfc):new ASObject();
    ComponentWrap cw=null;
    if(cfc instanceof ComponentAccess)cw=ComponentWrap.toComponentWrap(Component.ACCESS_REMOTE,cfc);
   
    Iterator it = cfc.entrySet().iterator();
        Map.Entry entry;
        Object v;
        Collection.Key k;
        UDF udf;
        String name;
        while(it.hasNext()) {
            entry=(Entry) it.next();
            k=KeyImpl.toKey(entry.getKey());
            v=entry.getValue();
           
            // add getters
            if(v instanceof UDF){
              if(!doGetters) continue;
              udf=(UDF) v;
              name=udf.getFunctionName();
              if(!StringUtil.startsWithIgnoreCase(name, "get"))continue;
              if(udf.getReturnType()==CFTypes.TYPE_VOID) continue;
              if(udf.getFunctionArguments().length>0) continue;
             
              try {
          v=cfc.call(ThreadLocalPageContext.get(), name, ArrayUtil.OBJECT_EMPTY);
        } catch (PageException e) {
          continue;
        }
              name=name.substring(3);
             
              aso.put(toString(name,forceCFCLower), toAMFObject(v));
            }
           
            // add remote data members
            if(cw!=null && doRemoteValues){
              v=cw.get(k,null);
              if(v!=null)aso.put(toString(k,forceCFCLower), toAMFObject(v));
            }
        }
        return aso;
  }
View Full Code Here


        Page p = PageSourceImpl.loadPage(pc, ((PageContextImpl)pc).getPageSources(name), null) ;

        if(p==null)throw new ApplicationException("Could not find a Component with name ["+aso.getType()+"]");
       
        Component cfc = ComponentLoader.loadComponent(pc, p, p.getPageSource(), aso.getType(), false);
        ComponentWrap cw=ComponentWrap.toComponentWrap(config.getComponentDataMemberDefaultAccess(),cfc);
       
        Iterator it = aso.entrySet().iterator();
        Map.Entry entry;
        while(it.hasNext()){
          entry = (Entry) it.next();
          cw.set(KeyImpl.toKey(entry.getKey()), toCFMLObject(entry.getValue()));
        }
        return cfc;
     
     
    }
View Full Code Here

TOP

Related Classes of railo.runtime.ComponentWrap

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.