Package railo.runtime.type.scope

Examples of railo.runtime.type.scope.Argument


   
    private Object _call(PageContext pc,Collection.Key calledName, Object[] args, Struct values,boolean doIncludePath) throws PageException {
     
      //print.out(count++);
      PageContextImpl pci=(PageContextImpl) pc;
      Argument newArgs= pci.getScopeFactory().getArgumentInstance();
        newArgs.setFunctionArgumentNames(properties.argumentsSet);
        LocalImpl newLocal=pci.getScopeFactory().getLocalInstance();
       
    Undefined   undefined=pc.undefinedScope();
    Argument  oldArgs=pc.argumentsScope();
        Local    oldLocal=pc.localScope();
        Collection.Key oldCalledName=pci.getActiveUDFCalledName();
       
    pc.setFunctionScopes(newLocal,newArgs);
    pci.setActiveUDFCalledName(calledName);
View Full Code Here


    public Object onMissingMethod(PageContext pc, int access,Member member,String name,Object _args[],Struct _namedArgs, boolean superAccess) throws PageException {
      Member ommm = access==-1?
          getMember(pc,KeyConstants._onmissingmethod,false, superAccess):
          getMember(access,KeyConstants._onmissingmethod,false, superAccess);
        if(ommm instanceof UDF) {
          Argument args=new ArgumentImpl();
          if(_args!=null) {
            for(int i=0;i<_args.length;i++) {
              args.setEL(ArgumentIntKey.init(i+1), _args[i]);
            }
          }
          else if(_namedArgs!=null) {
            UDFUtil.argumentCollection(_namedArgs, new FunctionArgument[]{});
           
            Iterator<Entry<Key, Object>> it = _namedArgs.entryIterator();
            Entry<Key, Object> e;
            while(it.hasNext()){
              e = it.next();
              args.setEL(e.getKey(),e.getValue());
            }
           
          }
         
          //Struct newArgs=new StructImpl(StructImpl.TYPE_SYNC);
View Full Code Here

   
    //String encodings = pc.getHttpServletRequest().getHeader("Accept-Encoding");
   
    Undefined undefined=pc.us();
   
    Argument newArgs=new ArgumentThreadImpl((Struct) Duplicator.duplicate(attrs,false));
        LocalImpl newLocal=pc.getScopeFactory().getLocalInstance();
        //Key[] keys = attrs.keys();
        Iterator<Entry<Key, Object>> it = attrs.entryIterator();
        Entry<Key, Object> e;
    while(it.hasNext()){
      e = it.next();
      newArgs.setEL(e.getKey(),e.getValue());
    }
   
    newLocal.setEL(KEY_ATTRIBUTES, newArgs);

    Argument oldArgs=pc.argumentsScope();
        Local oldLocal=pc.localScope();
       
        int oldMode=undefined.setMode(Undefined.MODE_LOCAL_OR_ARGUMENTS_ALWAYS);
    pc.setFunctionScopes(newLocal,newArgs);
   
View Full Code Here

        PageContextImpl pci=(PageContextImpl) pc;
        Undefined undefined=(Undefined) scope;
       
        boolean check=undefined.getCheckArguments();
        Variables orgVar=pc.variablesScope();
        Argument orgArgs=pc.argumentsScope();
            Local orgLocal=pc.localScope();
       
        pci.setVariablesScope(undefined.variablesScope());
        if(check)pci.setFunctionScopes(undefined.localScope(), undefined.argumentsScope());
            try{
View Full Code Here

    Object value=values.removeEL(KeyConstants._argumentCollection);
    if(value !=null) {
      value=Caster.unwrap(value,value);
     
      if(value instanceof Argument) {
        Argument argColl=(Argument) value;
        Iterator<Key> it = argColl.keyIterator();
        Key k;
        int i=-1;
          while(it.hasNext()) {
            i++;
            k = it.next();
            if(funcArgs.length>i && k instanceof ArgumentIntKey) {
                  if(!values.containsKey(funcArgs[i].getName()))
                    values.setEL(funcArgs[i].getName(),argColl.get(k,Argument.NULL));
                  else
                    values.setEL(k,argColl.get(k,Argument.NULL));
            }
                else if(!values.containsKey(k)){
                  values.setEL(k,argColl.get(k,Argument.NULL));
                }
              }
        }
      else if(value instanceof Collection) {
            Collection argColl=(Collection) value;
          //Collection.Key[] keys = argColl.keys();
        Iterator<Key> it = argColl.keyIterator();
        Key k;
        while(it.hasNext()) {
            k = it.next();
            if(!values.containsKey(k)){
                  values.setEL(k,argColl.get(k,Argument.NULL));
                }
              }
        }
      else if(value instanceof Map) {
        Map map=(Map) value;
View Full Code Here

    if(objs.length>1 && objs[objs.length-1] instanceof Scope){
     
      // Variables Scope
      Variables var=null;
      Local lcl=null,cLcl=null;
      Argument arg=null,cArg=null;
      if(objs[objs.length-1] instanceof Variables){
        var=(Variables) objs[objs.length-1];
      }
      else if(objs[objs.length-1] instanceof CallerImpl){
        CallerImpl ci = ((CallerImpl) objs[objs.length-1]);
        var=ci.getVariablesScope();
        lcl = ci.getLocalScope();
        arg = ci.getArgumentsScope();
      }
     
      if(var!=null){
        Variables cVar=pc.variablesScope();
        pc.setVariablesScope(var);
        if(lcl!=null && !(lcl instanceof LocalNotSupportedScope)) {
          cLcl = pc.localScope();
          cArg=pc.argumentsScope();
          pc.setFunctionScopes(lcl, arg);
        }
            try{
              return _call(pc, objs,objs.length-1,preciseMath);
            }
            finally{
              pc.setVariablesScope(cVar);
              if(cLcl!=null) pc.setFunctionScopes(cLcl, cArg);
            }
      }
     
      // Undefined Scope
      else if(objs[objs.length-1] instanceof Undefined) {
        PageContextImpl pci=(PageContextImpl) pc;
        Undefined undefined=(Undefined) objs[objs.length-1];
       
        boolean check=undefined.getCheckArguments();
        Variables orgVar=pc.variablesScope();
        Argument orgArgs=pc.argumentsScope();
            Local orgLocal=pc.localScope();
       
        pci.setVariablesScope(undefined.variablesScope());
        if(check)pci.setFunctionScopes(undefined.localScope(), undefined.argumentsScope());
            try{
View Full Code Here

TOP

Related Classes of railo.runtime.type.scope.Argument

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.