Package railo.runtime.type

Examples of railo.runtime.type.Array


  private void callCFCMetaData(PageContext pc, Component cfc, int format) throws IOException, PageException, ConverterException {
    ComponentAccess ca = ComponentUtil.toComponentAccess(cfc);
    ComponentWrap cw = new ComponentWrap(Component.ACCESS_REMOTE,ca)
    ComponentScope scope = cw.getComponentScope();
    Struct udfs=new StructImpl(),sctUDF,sctArg;
    Array arrArg;
    Iterator<Object> it = scope.valueIterator();
    Object v;
    UDF udf;
    FunctionArgument[] args;
    while(it.hasNext()){
        v=it.next();
          // UDF
        if(v instanceof UDF) {
          udf=(UDF) v;
            sctUDF=new StructImpl();
            arrArg=new ArrayImpl();
            udfs.setEL(udf.getFunctionName(), sctUDF);
            args = udf.getFunctionArguments();
            for(int i=0;i<args.length;i++){
              sctArg=new StructImpl();
              arrArg.appendEL(sctArg);
              sctArg.setEL(KeyConstants._name, args[i].getName().getString());
              sctArg.setEL(KeyConstants._type, args[i].getTypeAsString());
              sctArg.setEL(KeyConstants._required, args[i].isRequired());
              if(!StringUtil.isEmpty(args[i].getHint()))sctArg.setEL(KeyConstants._hint, args[i].getHint());
            }
View Full Code Here


        }
       
        if(strType.endsWith("[]") && Decision.isArray(o)){
        String _strType=strType.substring(0,strType.length()-2);
        short _type=CFTypes.toShort(_strType, false, (short)-1);
        Array arr = Caster.toArray(o,null);
        if(arr!=null){
         
          // convert the values
          Iterator<Entry<Key, Object>> it = arr.entryIterator();
          Array _arr=new ArrayImpl();
          Entry<Key, Object> e;
          Object src,trg;
          boolean hasChanged=false;
          while(it.hasNext()){
            e = it.next();
            src=e.getValue();
            trg=castTo(pc, _type, _strType, src);
            _arr.setEL(e.getKey(), trg);
            if(src!=trg) hasChanged=true;
          }
          if(!hasChanged) return arr;
          return _arr;
        }
View Full Code Here

 
  public static Query toQuery(Struct data,boolean hasDC) throws DatabaseException {
    Query qry=new QueryImpl(hasDC?COLUMNS_WITH_DC:COLUMNS,0,"");
   
    String version=Caster.toString(data.get(VERSION,""),"");
    Array items=null;
    if(StringUtil.startsWithIgnoreCase(version,"rss") || StringUtil.startsWithIgnoreCase(version,"rdf"))  {
      items=Caster.toArray(data.get(ITEM, null),null);
      if(items==null) {
        Struct sct=Caster.toStruct(data.get(version,null),null,false);
        if(sct!=null){
View Full Code Here

  private static Struct toStruct(Object value) {
    if(value instanceof Struct) return (Struct) value;
   
    if(value instanceof Array)  {
      Struct sct=new StructImpl(),row;
      Array arr = (Array)value;
      int len=arr.size();
      //Key[] keys;
      Iterator<Entry<Key, Object>> it;
      Entry<Key, Object> e;
      String nw;
      Object ext;
      for(int i=1;i<=len;i++){
        row=Caster.toStruct(arr.get(i,null),null,false);
        if(row==null)continue;
        it = row.entryIterator();
        //keys = row.keys();
        while(it.hasNext()){
          e = it.next();
View Full Code Here

       
        if(offset <= strInput.length() && matcher.contains(input, pattern)) {
            MatchResult result = matcher.getMatch();
           
            int groupCount = result.groups();
            Array posArray = new ArrayImpl();
            Array lenArray = new ArrayImpl();
            for(int i = 0; i < groupCount; i++) {
                int off = result.beginOffset(i);
                posArray.appendEL(Integer.valueOf(off + 1));
                lenArray.appendEL(Integer.valueOf(result.endOffset(i) - off));
            }
            Struct struct = new StructImpl();
            struct.setEL("pos", posArray);
            struct.setEL("len", lenArray);
            return struct;
           
        }
        Array posArray = new ArrayImpl();
        Array lenArray = new ArrayImpl();
        posArray.appendEL(Constants.INTEGER_0);
        lenArray.appendEL(Constants.INTEGER_0);
       
        Struct struct = new StructImpl();
        struct.setEL("pos", posArray);
        struct.setEL("len", lenArray);
        return struct;
View Full Code Here

       
       
        Pattern pattern = getPattern(strPattern,compileOptions);
       
       
        Array rtn = new ArrayImpl();
        MatchResult result;
        while(matcher.contains(input, pattern)) {
          result = matcher.getMatch()
          rtn.appendEL(result.toString());
          /*
          System.out.println("Match: " + result.toString());
          System.out.println("Length: " + result.length());
          groups = result.groups();
          System.out.println("Groups: " + groups);
View Full Code Here

   * @param el Struct Object as XML Element
   * @return Struct Object
   * @throws ConverterException
   */
  private Array _deserializeArray(Element el) throws ConverterException {
    Array array=new ArrayImpl();
   
    NodeList list=el.getChildNodes();
    int len=list.getLength();
    for(int i=0;i<len;i++) {
      Node node=list.item(i);
      if(node instanceof Element)
        try {
          array.append(_deserialize((Element)node));
        } catch (PageException e) {
          throw toConverterException(e);
        }
     
    }
View Full Code Here

 
  private FeedDeclaration(Map<String,El> declaration, String entryLevel,String type) {
    this.declaration=declaration;
   
    if(!StringUtil.isEmpty(entryLevel)) {
      Array array = ListUtil.listToArray(entryLevel, '.');
      this.entryLevel=new Collection.Key[array.size()];
          for(int i=0;i<this.entryLevel.length;i++) {
            this.entryLevel[i]=KeyImpl.toKey(array.get(i+1,null),null);
          }
    }
    else this.entryLevel=new Collection.Key[0];
    this.type=type;
  }
View Full Code Here

        }
        if(value instanceof byte[]) {
          return value;
        }
        if(Decision.isArray(value)) {
            Array a = Caster.toArray(value);
            int len=a.size();
            Object o;
            for(int i=1;i<=len;i++) {
                o=a.get(i,null);
                if(o!=null)a.setEL(i,toCFML(o));
            }
            return a;
        }
        if(value instanceof Map) {
          Struct sct = new StructImpl();
View Full Code Here

      Object obj = data.get(inside, null);
      if(obj instanceof Array)  {
        ((Array)obj).appendEL(sct);
      }
      else if(obj instanceof FeedStruct){
        Array arr = new ArrayImpl();
        arr.appendEL(obj);
        arr.appendEL(sct);
        data.setEL(inside, arr);
      }
      else if(obj instanceof String){
        // wenn wert schon existiert wird castableArray in setContent erstellt
      }
      else {
        El el= decl.getDeclaration().get(path);
        if(el!=null && (el.getQuantity()==El.QUANTITY_0_N || el.getQuantity()==El.QUANTITY_1_N)){
          Array arr = new ArrayImpl();
          arr.appendEL(sct);
          data.setEL(inside, arr);
        }
        else data.setEL(inside, sct);
       
      }
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.