Examples of UDF


Examples of railo.runtime.type.UDF

 
 
  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

Examples of railo.runtime.type.UDF

  }

  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

Examples of railo.runtime.type.UDF

  }
 
  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

Examples of railo.runtime.type.UDF

  }

  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

Examples of railo.runtime.type.UDF

  }

  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

Examples of railo.runtime.type.UDF

   
    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

Examples of railo.runtime.type.UDF

    }
   
    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

Examples of railo.runtime.type.UDF

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

Examples of railo.runtime.type.UDF

    }
   
    private static String castToJson(PageContext pc,Component cfc, String defaultValue) throws ConverterException {
    Object o=cfc.get(TO_JSON,null);
    if(!(o instanceof UDF)) return defaultValue;
    UDF udf=(UDF) o;
    if(udf.getReturnType()!=CFTypes.TYPE_VOID && udf.getFunctionArguments().length==0) {
      try {
        return Caster.toString(cfc.call(pc, TO_JSON, new Object[0]));
      } catch (PageException e) {
        e.printStackTrace();
        throw toConverterException(e);
View Full Code Here

Examples of railo.runtime.type.UDF

   
   
    Iterator<Entry<Key, Object>> it = component.entryIterator();
    Entry<Key, Object> e;
    Object value;
    UDF udf;
    Struct meta;
    int status=404;
    MimeType bestP,bestC;
    while(it.hasNext()){
      e = it.next();
      value=e.getValue();
      if(value instanceof UDF){
        udf=(UDF)value;
        try {
          meta = udf.getMetaData(pc);
         
          // check if http method match
          String httpMethod = Caster.toString(meta.get(KeyConstants._httpmethod,null),null);
          if(StringUtil.isEmpty(httpMethod) || !httpMethod.equalsIgnoreCase(method)) continue;
         
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.