Package railo.runtime.type

Examples of railo.runtime.type.Array


     
       
    // pathes from system properties
        String strPathes=System.getProperty("java.class.path");
        if(strPathes!=null) {
            Array arr=ListUtil.listToArrayRemoveEmpty(strPathes,pathSeperator);
            int len=arr.size();
            for(int i=1;i<=len;i++) {
                Resource file=frp.getResource(Caster.toString(arr.get(i,""),"").trim());
                if(file.exists())
                    pathes.add(ResourceUtil.getCanonicalResourceEL(file));
            }
        }
       
View Full Code Here


    if(pathSeperator==null)pathSeperator=";";
     
  // pathes from system properties
    String strPathes=System.getProperty("java.class.path");
    if(strPathes!=null) {
      Array arr=ListUtil.listToArrayRemoveEmpty(strPathes,pathSeperator);
      int len=arr.size();
      for(int i=1;i<=len;i++) {
        File file=FileUtil.toFile(Caster.toString(arr.get(i,""),"").trim());
        if(file.exists())
          try {
            pathes.put(file.getCanonicalPath(),"");
          } catch (IOException e) {}
      }
View Full Code Here

    StringBuilder javaName=new StringBuilder();
    while(str.indexOf('/')==0)str=str.substring(1);
    while(str.lastIndexOf('/')==str.length()-1)str=str.substring(0,str.length()-1);
   
    //String[] arr=str.split("/");
    Array arr = ListUtil.listToArray(str, '/');
    int len=arr.size();
    String value;
    for(int i=1;i<=len;i++) {
      value=(String) arr.get(i,"");
      String varName=StringUtil.toVariableName(value);
      javaName.append("/"+varName);
      if(i==len) {
        className=varName.toLowerCase();
      }
View Full Code Here

  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

   
    // init
    if(qry==null){
      ClassMetadata md = ((HibernateORMEngine)session.getEngine()).getSessionFactory(pc).getClassMetadata(getEntityName(cfc));
      //Struct columnsInfo= engine.getTableInfo(session.getDatasourceConnection(),toEntityName(engine, cfc),session.getEngine());
      Array names=CommonUtil.createArray();
      Array types=CommonUtil.createArray();
      String name;
      //ColumnInfo ci;
      int t;
      Object obj;
      Struct sct;
      String fieldType;
      for(int i=0;i<properties.length;i++){
        obj = properties[i].getMetaData();
        if(obj instanceof Struct) {
          sct=(Struct) obj;
          fieldType = CommonUtil.toString(sct.get(CommonUtil.FIELDTYPE,null),null);
          if("one-to-many".equalsIgnoreCase(fieldType) || "many-to-many".equalsIgnoreCase(fieldType) || "many-to-one".equalsIgnoreCase(fieldType) || "one-to-one".equalsIgnoreCase(fieldType))
            continue;
         
        }
       
        name=HibernateUtil.validateColumnName(md, properties[i].getName(),null);
        //if(columnsInfo!=null)ci=(ColumnInfo) columnsInfo.get(name,null);
        //else ci=null;
        names.append(name);
        if(name!=null){
         
          t=HibernateCaster.toSQLType(HibernateUtil.getPropertyType(md, name).getName(), NULL);
          if(t==NULL)
            types.append("object");
          else
            types.append(SQLCaster.toStringType(t));
        }
        else
          types.append("object");
      }
     
      qry=CommonUtil.createQuery(names,types,0,getEntityName(cfc));
     
    }
View Full Code Here

  private static Query inheritance(PageContext pc,HibernateORMSession session,Component cfc,Query qry, String entityName) throws PageException {
    Property[] properties = cfc.getProperties(true);
    ComponentScope scope = cfc.getComponentScope();
    Object value;
    Array arr;
    for(int i=0;i<properties.length;i++){
      value=scope.get(CommonUtil.createKey(properties[i].getName()),null);
      if(value instanceof Component){
        qry=inheritance(pc,session,qry,cfc,(Component) value,entityName);
      }
      else if(CommonUtil.isArray(value)){
        arr = CommonUtil.toArray(value);
        Iterator<Object> it = arr.valueIterator();
        while(it.hasNext()){
          value=it.next();
          if(value instanceof Component){
            qry=inheritance(pc,session,qry,cfc,(Component) value,entityName);
          }
View Full Code Here

  public static int toIntValue(Object obj, int defaultValue) {
    return caster().toIntValue(obj,defaultValue);
  }
 
  public static Array toArray(Argument arg) {
    Array trg=createArray();
    int[] keys = arg.intKeys();
    for(int i=0;i<keys.length;i++){
      trg.setEL(keys[i],
          arg.get(keys[i],null));
    }
    return trg;
  }
View Full Code Here

  }
 
  public static Array toCFML(List src)  {
        int size=src.size();
       
        Array trg = CommonUtil.createArray();
        for(int i=0;i<size;i++) {
            trg.setEL(i+1,toCFML(src.get(i)));
        }
        return trg;
  }
View Full Code Here

      qry= toQuery(pc,session,HibernateCaster.toComponent(obj),name,null,1,1);
    }
   
    // a array of entities
    else {
      Array arr=CommonUtil.toArray(obj);
      int len=arr.size();
      if(len>0) {
        Iterator<Object> it = arr.valueIterator();
        int row=1;
        while(it.hasNext()){
          qry=toQuery(pc,session,HibernateCaster.toComponent(it.next()),name,qry,len,row++);
        }
      }
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")) {
View Full Code Here

TOP

Related Classes of railo.runtime.type.Array

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.