Package railo.runtime.type

Examples of railo.runtime.type.UDF


  private static int createMethod(BytecodeContext statConstr,BytecodeContext constr, java.util.List<LitString> keys,ClassWriter cw,String className, Object member,int max,boolean writeLog, boolean supressWSbeforeArg) throws PageException {
   
    boolean hasOptionalArgs=false;
   
      if(member instanceof UDF) {
        UDF udf = (UDF) member;
        FunctionArgument[] args = udf.getFunctionArguments();
        Type[] types=new Type[max<0?args.length:max];
        for(int y=0;y<types.length;y++){
          types[y]=toType(args[y].getTypeAsString(),true);//Type.getType(Caster.cfTypeToClass(args[y].getTypeAsString()));
          if(!args[y].isRequired())hasOptionalArgs=true;
        }
        Type rtnType=toType(udf.getReturnTypeAsString(),true);
            Method method = new Method(
                udf.getFunctionName(),
                rtnType,
              types
                );
            GeneratorAdapter adapter = new GeneratorAdapter(Opcodes.ACC_PUBLIC+Opcodes.ACC_FINAL , method, null, null, cw);
            BytecodeContext bc = new BytecodeContext(null,statConstr,constr,getPage(statConstr,constr),keys,cw,className,adapter,method,writeLog,supressWSbeforeArg);
            Label start=adapter.newLabel();
            adapter.visitLabel(start);
           
       //ComponentController.invoke(name, args);
            // name
            adapter.push(udf.getFunctionName());
           
            // args
            ArrayVisitor av=new ArrayVisitor();
            av.visitBegin(adapter,Types.OBJECT,types.length);
            for(int y=0;y<types.length;y++){
View Full Code Here


    Arrays.sort(keys);
   
    StringBuffer _interface=new StringBuffer();
   
    Object member;
        UDF udf;
        FunctionArgument[] args;
        FunctionArgument arg;
        for(int y=0;y<keys.length;y++) {
          member = cw.get(keys[y],null);
          if(member instanceof UDF) {
            udf=(UDF) member;
            //print.out(udf.);
            _interface.append(udf.getAccess());
            _interface.append(udf.getOutput());
            _interface.append(udf.getFunctionName());
            _interface.append(udf.getReturnTypeAsString());
            args = udf.getFunctionArguments();
            for(int i=0;i<args.length;i++){
              arg=args[i];
                _interface.append(arg.isRequired());
                _interface.append(arg.getName());
                _interface.append(arg.getTypeAsString());
View Full Code Here

 
 
  public static void addGet(ComponentImpl comp, Property prop) {
    Member m = comp.getMember(Component.ACCESS_PRIVATE,KeyImpl.getInstance("get"+prop.getName()),true,false);
    if(!(m instanceof UDF)){
      UDF udf = new UDFGetterProperty(comp,prop);
      comp.registerUDF(udf.getFunctionName(), udf);
    }
  }
View Full Code Here

  }

  public static void addSet(ComponentImpl comp, Property prop) throws PageException {
    Member m = comp.getMember(Component.ACCESS_PRIVATE,KeyImpl.getInstance("set"+prop.getName()),true,false);
    if(!(m instanceof UDF)){
      UDF udf = new UDFSetterProperty(comp,prop);
      comp.registerUDF(udf.getFunctionName(), udf);
    }
  }
View Full Code Here

  }
 
  public static void addHas(ComponentImpl comp, Property prop) {
    Member m = comp.getMember(Component.ACCESS_PRIVATE,KeyImpl.getInstance("has"+getSingularName(prop)),true,false);
    if(!(m instanceof UDF)){
      UDF udf = new UDFHasProperty(comp,prop);
      comp.registerUDF(udf.getFunctionName(), udf);
    }
  }
View Full Code Here

  }

  public static void addAdd(ComponentImpl comp, Property prop) {
    Member m = comp.getMember(ComponentImpl.ACCESS_PRIVATE,KeyImpl.getInstance("add"+getSingularName(prop)),true,false);
    if(!(m instanceof UDF)){
      UDF udf = new UDFAddProperty(comp,prop);
      comp.registerUDF(udf.getFunctionName(), udf);
    }
  }
View Full Code Here

  }

  public static void addRemove(ComponentImpl comp, Property prop) {
    Member m = comp.getMember(Component.ACCESS_PRIVATE,KeyImpl.getInstance("remove"+getSingularName(prop)),true,false);
    if(!(m instanceof UDF)){
      UDF udf = new UDFRemoveProperty(comp,prop);
      comp.registerUDF(udf.getFunctionName(), udf);
    }
  }
View Full Code Here

   
    private static void addUDFS(ComponentImpl trgComp, Map src, Map trg) {
    Iterator it = src.entrySet().iterator();
    Map.Entry entry;
    Object key,value;
    UDF udf;
    ComponentImpl comp,owner;
    boolean done;
      while(it.hasNext()){
        entry=(Entry) it.next();
        key=entry.getKey();
        value=entry.getValue();
        if(value instanceof UDF) {
          udf=(UDF) value;
          done=false;
          // get udf from _udf
          owner = (ComponentImpl)udf.getOwnerComponent();
          if(owner!=null) {
            comp=trgComp;
            do{
              if(owner.pageSource==comp.pageSource)
                break;
            }
            while((comp=comp.base)!=null);
            if(comp!=null) {
              value=comp._udfs.get(key);
              trg.put(key, value);
              done=true;
            }
          }
          // udf with no owner
          if(!done)
            trg.put(key, udf.duplicate());
         
          //print.o(owner.pageSource.getComponentName()+":"+udf.getFunctionName());
        }
      }
  }
View Full Code Here

    }
   
    public static MapPro<Key, UDF> duplicateUTFMap(ComponentImpl src,ComponentImpl trg,MapPro<Key,UDF> srcMap, MapPro<Key, UDF> trgMap){
      Iterator<Entry<Key, UDF>> it = srcMap.entrySet().iterator();
        Entry<Key, UDF> entry;
        UDF udf;
        while(it.hasNext()) {
            entry=it.next();
            udf=entry.getValue();
         
            if(udf.getOwnerComponent()==src) {
              UDFPlus clone=(UDFPlus) entry.getValue().duplicate();
            clone.setOwnerComponent(trg);
            clone.setAccess(udf.getAccess());
            trgMap.put(entry.getKey(),clone)
            }
         
        }
        return trgMap;
View Full Code Here

      }
     
      // 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

TOP

Related Classes of railo.runtime.type.UDF

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.