Package railo.runtime.type

Examples of railo.runtime.type.ArrayImpl


  private static Array fonts;
  private static Graphics2D graphics;

  public synchronized static Array getAvailableFontsAsStringArray() {
     Iterator<Object> it = getAvailableFonts(false).valueIterator();
    Array arr=new ArrayImpl();
    while(it.hasNext()) {
      arr.appendEL(((Font)it.next()).getFontName());
    }
    return arr;
  }
View Full Code Here


    return arr;
  }
  private synchronized static Array getAvailableFonts(boolean duplicate) {
    if (fonts == null) {
         
      fonts = new ArrayImpl();
            GraphicsEnvironment graphicsEvn = GraphicsEnvironment.getLocalGraphicsEnvironment();
            Font[] availableFonts = graphicsEvn.getAllFonts();
            for (int i = 0; i < availableFonts.length; i++) {
            fonts.appendEL(availableFonts[i]);
            }
View Full Code Here

     
    //responseHeader
      Header[] headers = httpMethod.getResponseHeaders();
      StringBuffer raw=new StringBuffer(httpMethod.getStatusLine().toString()+" ");
      Struct responseHeader = new StructImpl();
      Array setCookie = new ArrayImpl();
     
          for(int i=0;i<headers.length;i++) {
            Header header=headers[i];
            //print.ln(header);
           
            raw.append(header+" ");
            if(header.getName().equalsIgnoreCase("Set-Cookie"))
              setCookie.append(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);
          responseHeader.set(STATUS_CODE,new Double(httpMethod.getStatusCode()));
          responseHeader.set(EXPLANATION,(httpMethod.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

        }
        return qry;
    }
   
    private void getResourceProviders(ResourceProvider[] providers,Query qry,Element p, int row,Boolean def) throws PageException {
      Array support=new ArrayImpl();
        String clazz=p.getAttribute("class");
      qry.setAt("scheme",row,p.getAttribute("scheme"));
      qry.setAt("arguments",row,p.getAttribute("arguments"));
      qry.setAt("class",row,clazz);
      for(int i=0;i<providers.length;i++) {
        if(providers[i].getClass().getName().equals(clazz)){
          if(providers[i].isAttributesSupported())support.append("attributes");
                if(providers[i].isModeSupported())support.append("mode");
                qry.setAt("support",row,ListUtil.arrayToList(support, ","));
                qry.setAt("scheme",row,providers[i].getScheme());
                qry.setAt("caseSensitive",row,Caster.toBoolean(providers[i].isCaseSensitive()));
                qry.setAt("default",row,def);
          break;
View Full Code Here

        Object obj=thisTag.get(datacollection,null);
       
        Array array;

        if(obj==null) {
            array=new ArrayImpl(new Object[]{value});
            thisTag.set(datacollection,array);  
        }
        else if(Decision.isArray(obj) && (array=Caster.toArray(obj)).getDimension()==1) {
            array.append(value);
        }
        else {
            array=new ArrayImpl(new Object[]{obj,value});
            thisTag.set(datacollection,array);  
        }
    return SKIP_BODY;
  }
View Full Code Here

        listOnlyNames?new String[]{"name"}:names,
        listOnlyNames?new String[]{"VARCHAR"}:types,
        0,"query");
      }
      else
        rtn=array=new ArrayImpl();
     
      if(!directory.exists()){
        if(directory instanceof FileResource) return rtn;
      throw new ApplicationException("directory ["+directory.toString()+"] doesn't exist");
    }
View Full Code Here


  public Object toStruct() {
   
    Resource[] locs = getCfcLocations();
    Array arrLocs=new ArrayImpl();
    if(locs!=null)for(int i=0;i<locs.length;i++){
      arrLocs.appendEL(getAbsolutePath(locs[i]));
    }
    Struct sct=new StructImpl();
    sct.setEL(AUTO_GEN_MAP,this.autogenmap());
    sct.setEL(CATALOG,StringUtil.emptyIfNull(getCatalog()));
    sct.setEL(CFC_LOCATION,arrLocs);
View Full Code Here

   * @param delimiter delimter of the list
   * @param quotes quotes of the list
   * @return Array Object
   */
  public static Array listWithQuotesToArray(String list, String delimiter,String quotes) {
    if(list.length()==0) return new ArrayImpl();
   
    int len=list.length();
    int last=0;
    char[] del=delimiter.toCharArray();
    char[] quo=quotes.toCharArray();
    char c;
    char inside=0;
   
    ArrayImpl array=new ArrayImpl();
    try{
      for(int i=0;i<len;i++) {
          c=list.charAt(i);
          for(int y=0;y<quo.length;y++){
            if(c==quo[y]) {
            if(c==inside)inside=0;
            else if(inside==0)inside=c;
            continue;
          }
          }
         
          for(int y=0;y<del.length;y++) {
          if(inside==0 && c==del[y]) {
            array._append(list.substring(last,i));
            last=i+1;
            break;
          }
          }
      }
      if(last<=len)array.append(list.substring(last));
    }
    catch(ExpressionException e){}
    return array;
  }
View Full Code Here

   * @param delimiter delimter of the list
   * @return Array Object
   */
  public static Array listToArray(String list, String delimiter) {
      if(delimiter.length()==1)return listToArray(list, delimiter.charAt(0));
      if(list.length()==0) return new ArrayImpl();
      if(delimiter.length()==0) {
        int len = list.length();
        ArrayImpl array=new ArrayImpl();
        array.appendEL("");// ACF compatibility
      for(int i=0;i<len;i++){
          array.appendEL(list.charAt(i));
        }
      array.appendEL("");// ACF compatibility
      return array;
      }
   
      int len=list.length();
    int last=0;
    char[] del=delimiter.toCharArray();
    char c;
   
    ArrayImpl array=new ArrayImpl();
    try{
      for(int i=0;i<len;i++) {
          c=list.charAt(i);
          for(int y=0;y<del.length;y++) {
          if(c==del[y]) {
            array.appendEL(list.substring(last,i));
            last=i+1;
            break;
          }
          }
      }
      if(last<=len)array.append(list.substring(last));
    }
    catch(ExpressionException e){}
    return array;
  }
View Full Code Here

 
  public static Array listToArray(String list, String delimiter, boolean multiCharDelim) {
    if(!multiCharDelim || delimiter.length()==0) return listToArray(list, delimiter);
    if(delimiter.length()==1)return listToArray(list, delimiter.charAt(0));
    int len=list.length();
    if(len==0) return new ArrayImpl();
    
    Array array=new ArrayImpl();
    int from=0;
    int index;
    int dl=delimiter.length();
    while((index=list.indexOf(delimiter,from))!=-1){
      array.appendEL(list.substring(from,index));
      from=index+dl;
    }
    array.appendEL(list.substring(from,len));
   
    return array;
  }
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.