Package railo.runtime.type.scope

Examples of railo.runtime.type.scope.Variables


      throw Caster.toPageException(e);
    }
  }

  void doInclude() throws PageException {
        Variables var=pageContext.variablesScope();
        pageContext.setVariablesScope(ctVariablesScope);
       
       
        QueryStack cs=null;
        Undefined undefined=pageContext.undefinedScope();
View Full Code Here


    }
 
  Object _call(PageContext pc, Collection.Key calledName,UDFPlus udf, Struct namedArgs, Object[] args) throws PageException {
     
    Object rtn=null;
    Variables parent=null;
       
    // INFO duplicate code is for faster execution -> less contions
   
   
    // debug yes
View Full Code Here

     * will be called before executing method or constructor
     * @param pc
     * @return the old scope map
     */
  public Variables beforeCall(PageContext pc) {
      Variables parent=pc.variablesScope();
      pc.setVariablesScope(scope);
      return parent;
    }
View Full Code Here

  public static Object _variable(PageContext pc,String str,Object value,Scope scope) throws PageException {
    // define a ohter enviroment for the function
    if(scope!=null){
     
      // Variables Scope
      Variables var=null;
      if(scope instanceof Variables){
        var=(Variables) scope;
      }
      else if(scope instanceof CallerImpl){
        var=((CallerImpl) scope).getVariablesScope();
      }
      if(var!=null){
        Variables current=pc.variablesScope();
        pc.setVariablesScope(var);
            try{
              if(value!=NULL) return setVariable(pc, str,value);
              return getVariable(pc, str);
            }
            finally{
              pc.setVariablesScope(current);
            }
      }
     
      // Undefined Scope
      else if(scope instanceof Undefined) {
        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());
View Full Code Here

      PageSourceImpl ps = (PageSourceImpl) mapping.getPageSource(filename);
      Page p = ps.loadPage(pc)
   
     
      // execute page
      Variables old = pc.variablesScope();
      pc.setVariablesScope(VAR);
      boolean wasSilent = pc.setSilent();
      try {
      p.call(pc);
      Object o= pc.variablesScope().get(name,null);
View Full Code Here

    return clo;
  }

  @Override
  public Object callWithNamedValues(PageContext pc,Collection.Key calledName, Struct values, boolean doIncludePath) throws PageException {
    Variables parent=pc.variablesScope();
        try{
          pc.setVariablesScope(variables);
          return super.callWithNamedValues(pc, calledName,values, doIncludePath);
    }
    finally {
View Full Code Here

    }
  }
 
  @Override
  public Object callWithNamedValues(PageContext pc, Struct values, boolean doIncludePath) throws PageException {
    Variables parent=pc.variablesScope();
        try{
          pc.setVariablesScope(variables);
          return super.callWithNamedValues(pc, values, doIncludePath);
    }
    finally {
View Full Code Here

    }
  }

  @Override
  public Object call(PageContext pc,Collection.Key calledName, Object[] args, boolean doIncludePath) throws PageException {
    Variables parent=pc.variablesScope();
    try{
          pc.setVariablesScope(variables);
      return super.call(pc, calledName, args, doIncludePath);
    }
    finally {
View Full Code Here

    }
  }

  @Override
  public Object call(PageContext pc, Object[] args, boolean doIncludePath) throws PageException {
    Variables parent=pc.variablesScope();
    try{
          pc.setVariablesScope(variables);
      return super.call(pc, args, doIncludePath);
    }
    finally {
View Full Code Here

  public static Object call(PageContext pc , Object[] objs, boolean preciseMath) throws PageException {
    // define a ohter enviroment for the function
    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());
View Full Code Here

TOP

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

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.