Package railo.runtime.type

Examples of railo.runtime.type.ArrayImpl


        else if(format==UDF.RETURN_FORMAT_JSONfunc.set(KeyConstants._returnFormat, "json");
        else if(format==UDF.RETURN_FORMAT_SERIALIZE)func.set(KeyConstants._returnFormat, "cfml");
       
       
        FunctionArgument[] args =  udf.arguments;
        Array params=new ArrayImpl();
        //Object defaultValue;
        Struct m;
        //Object defaultValue;
        for(int y=0;y<args.length;y++) {
            StructImpl param=new StructImpl();
            param.set(KeyConstants._name,args[y].getName().getString());
            param.set(KeyConstants._required,Caster.toBoolean(args[y].isRequired()));
            param.set(KeyConstants._type,args[y].getTypeAsString());
            displayname=args[y].getDisplayName();
            if(!StringUtil.isEmpty(displayname)) param.set(KeyConstants._displayname,displayname);
           
            int defType = args[y].getDefaultType();
            if(defType==FunctionArgument.DEFAULT_TYPE_RUNTIME_EXPRESSION){
              param.set(KeyConstants._default, "[runtime expression]");
            }
            else if(defType==FunctionArgument.DEFAULT_TYPE_LITERAL){
              param.set(KeyConstants._default,
                  UDFUtil.getDefaultValue(pc, udf.pageSource, udf.index, y, null));
            }
           
            hint=args[y].getHint();
            if(!StringUtil.isEmpty(hint))param.set(KeyConstants._hint,hint);
            // TODO func.set("userMetadata", value); neo unterst゚tzt irgendwelche attr, die dann hier ausgebenen werden blレdsinn
           
            // meta data
            m=args[y].getMetaData();
            if(m!=null) StructUtil.copy(m, param, true);
               
            params.append(param);
        }
        func.set(KeyConstants._parameters,params);
    return func;
  }
View Full Code Here


    //responseHeader
      railo.commons.net.http.Header[] headers = rsp.getAllHeaders();
      StringBuffer raw=new StringBuffer(rsp.getStatusLine()+" ");
      Struct responseHeader = new StructImpl();
      Struct cookie;
      Array setCookie = new ArrayImpl();
      Query cookies=new QueryImpl(new String[]{"name","value","path","domain","expires","secure","httpOnly"},0,"cookies");
     
          for(int i=0;i<headers.length;i++) {
            railo.commons.net.http.Header header=headers[i];
            //print.ln(header);
           
            raw.append(header.toString()+" ");
            if(header.getName().equalsIgnoreCase("Set-Cookie")) {
              setCookie.append(header.getValue());
              parseCookie(cookies,header.getValue());
            }
            else {
                //print.ln(header.getName()+"-"+header.getValue());
              Object value=responseHeader.get(KeyImpl.getInstance(header.getName()),null);
              if(value==null) responseHeader.set(KeyImpl.getInstance(header.getName()),header.getValue());
              else {
                  Array arr=null;
                  if(value instanceof Array) {
                      arr=(Array) value;
                  }
                  else {
                      arr=new ArrayImpl();
                      responseHeader.set(KeyImpl.getInstance(header.getName()),arr);
                      arr.appendEL(value);
                  }
                  arr.appendEL(header.getValue());
              }
            }
           
            // Content-Type
            if(header.getName().equalsIgnoreCase("Content-Type")) {
              mimetype=header.getValue();
              if(mimetype==null)mimetype=NO_MIMETYPE;
            }
           
            // Content-Encoding
            if(header.getName().equalsIgnoreCase("Content-Encoding")) {
              contentEncoding=header.getValue();
            }
           
          }
          cfhttp.set(RESPONSEHEADER,responseHeader);
          cfhttp.set(KeyConstants._cookies,cookies);
          responseHeader.set(STATUS_CODE,new Double(rsp.getStatusCode()));
          responseHeader.set(EXPLANATION,(rsp.getStatusText()));
          if(setCookie.size()>0)responseHeader.set(SET_COOKIE,setCookie);
         
      // is text
          boolean isText=
            mimetype == null || 
            mimetype == NO_MIMETYPE || HTTPUtil.isTextMimeType(mimetype);
View Full Code Here

            throw new ApplicationException("attribute value from tag queryparam is required if attribute null is false");
        if(list) {
          String v = Caster.toString(item.getValue());
          Array arr=null;
          if(StringUtil.isEmpty(v)){
            arr=new ArrayImpl();
            arr.append("");
          }
          else arr=ListUtil.listToArrayRemoveEmpty(v,separator);
       
        int len=arr.size();
View Full Code Here

      } catch (Throwable t) {}
           
       
        // Properties
        if(comp.properties.properties!=null) {
          ArrayImpl parr = new ArrayImpl();
          Property p;
          Iterator<Entry<String, Property>> pit = comp.properties.properties.entrySet().iterator();
          while(pit.hasNext()){
            p=pit.next().getValue();
            parr.append(p.getMetaData());
          }
          parr.sort(new ArrayOfStructComparator(KeyConstants._name));
          sct.set(KeyConstants._properties,parr);
        }

        page.metaData=new MetaDataSoftReference<Struct>(sct,creationTime);
        return sct;
View Full Code Here


 

  private static void metaUDFs(PageContext pc,ComponentImpl comp,Struct sct, int access) throws PageException {
      ArrayImpl arr=new ArrayImpl();
      //Collection.Key name;
       
      Page page = ((PageSourceImpl)comp._getPageSource()).getPage();
      if(page!=null && page.udfs!=null){
        for(int i=0;i<page.udfs.length;i++){
          if(page.udfs[i].getAccess()>access) continue;
            arr.append(ComponentUtil.getMetaData(pc,(UDFPropertiesImpl) page.udfs[i]));
        }
      }
     
      // property functions
      Iterator<Entry<Key, UDF>> it = comp._udfs.entrySet().iterator();
        Entry<Key, UDF> entry;
    UDF udf;
    while(it.hasNext()) {
        entry= it.next();
        udf=entry.getValue();
            if(udf.getAccess()>access || !(udf instanceof UDFGSProperty)) continue;
          if(comp.base!=null) {
                if(udf==comp.base.getMember(access,entry.getKey(),true,true))
                  continue;
              }
              arr.append(udf.getMetaData(pc));
           
        }
        if(arr.size()!=0)sct.set(KeyConstants._functions,arr);
  }
View Full Code Here

        return singelton;
    }

    @Override
    public Array createArray() {
        return new ArrayImpl();
    }
View Full Code Here

    return ListUtil.listToArray(list, delimiter);
  }
 
    @Override
    public Array createArray(int dimension) throws PageException {
        return new ArrayImpl(dimension);
    }
View Full Code Here

   * @param clazz
   * @return stored structure
   */
  private Array store(Class clazz) {
      Constructor[] conArr=clazz.getConstructors();
      Array args=new ArrayImpl();
      for(int i=0;i<conArr.length;i++) {
        storeArgs(conArr[i],args);
      }
      map.put(clazz,args);
      return args;
View Full Code Here

   
   
    Object o=methodsMap.get(methodName,null);
    Array methodArgs;
    if(o==null) {
      methodArgs=new ArrayImpl();
      methodsMap.setEL(methodName,methodArgs);
    }
    else methodArgs=(Array) o;
    storeArgs(method,methodArgs);
    //Modifier.isStatic(method.getModifiers());
View Full Code Here

  public long getPageContextsSize() {
    return SizeOf.size(pcs);
  }
 
  public Array getInfo() {
    Array info=new ArrayImpl();
   
    synchronized (runningPcs) {
            //int len=runningPcs.size();
      Iterator<Key> it = runningPcs.keyIterator();
            PageContextImpl pc;
            Struct data,sctThread,scopes;
        Collection.Key key;
            Thread thread;
        while(it.hasNext()) {
              data=new StructImpl();
              sctThread=new StructImpl();
              scopes=new StructImpl();
              data.setEL("thread", sctThread);
                data.setEL("scopes", scopes);
               
             
              key=KeyImpl.toKey(it.next(),null);
                //print.out("key:"+key);
                pc=(PageContextImpl) runningPcs.get(key,null);
                if(pc==null || pc.isGatewayContext()) continue;
                thread=pc.getThread();
                if(thread==Thread.currentThread()) continue;

               
                thread=pc.getThread();
                if(thread==Thread.currentThread()) continue;
               
              
               
                data.setEL("startTime", new DateTimeImpl(pc.getStartTime(),false));
                data.setEL("endTime", new DateTimeImpl(pc.getStartTime()+pc.getRequestTimeout(),false));
                data.setEL(KeyConstants._timeout,new Double(pc.getRequestTimeout()));

               
                // thread
                sctThread.setEL(KeyConstants._name,thread.getName());
                sctThread.setEL("priority",Caster.toDouble(thread.getPriority()));
                data.setEL("TagContext",PageExceptionImpl.getTagContext(pc.getConfig(),thread.getStackTrace() ));

                data.setEL("urlToken", pc.getURLToken());
                try {
          if(pc.getConfig().debug())data.setEL("debugger", pc.getDebugger().getDebuggingData(pc));
        } catch (PageException e2) {}

                try {
          data.setEL("id", Hash.call(pc, pc.getId()+":"+pc.getStartTime()));
        } catch (PageException e1) {}
                data.setEL("requestid", pc.getId());

                // Scopes
                scopes.setEL(KeyConstants._name, pc.getApplicationContext().getName());
                try {
          scopes.setEL(KeyConstants._application, pc.applicationScope());
        } catch (PageException e) {}

                try {
          scopes.setEL(KeyConstants._session, pc.sessionScope());
        } catch (PageException e) {}
               
                try {
          scopes.setEL(KeyConstants._client, pc.clientScope());
        } catch (PageException e) {}
                scopes.setEL(KeyConstants._cookie, pc.cookieScope());
                scopes.setEL(KeyConstants._variables, pc.variablesScope());
                if(!(pc.localScope() instanceof LocalNotSupportedScope)){
                  scopes.setEL(KeyConstants._local, pc.localScope());
                  scopes.setEL(KeyConstants._arguments, pc.argumentsScope());
                }
                scopes.setEL(KeyConstants._cgi, pc.cgiScope());
                scopes.setEL(KeyConstants._form, pc.formScope());
                scopes.setEL(KeyConstants._url, pc.urlScope());
                scopes.setEL(KeyConstants._request, pc.requestScope());
               
                info.appendEL(data);
            }
            return info;
        }
  }
View Full Code Here

TOP

Related Classes of railo.runtime.type.ArrayImpl

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.