Package railo.runtime.component

Examples of railo.runtime.component.Property


  private static void _getProperties(ComponentImpl c,Map<String,Property> props,boolean onlyPeristent, boolean includeBaseProperties, boolean preferBaseProperties, boolean inheritedMappedSuperClassOnly) {
    //if(c.properties.properties==null) return new Property[0];
   
    // collect with filter
    if(c.properties.properties!=null){
      Property p;
      Iterator<Entry<String, Property>> it = c.properties.properties.entrySet().iterator();
      while(it.hasNext())  {
        p = it.next().getValue();
        if(!onlyPeristent || p.isPeristent()) {
          if (!preferBaseProperties || !props.containsKey(p.getName().toLowerCase())) {
            props.put(p.getName().toLowerCase(),p);
          }
        }
      }
    }
View Full Code Here


          ComponentScope scope = ci.getComponentScope();
          Iterator<Entry<Key, Object>> it = scope.entryIterator();
            sb.append(",{");
          deep++;
          doIt=false;
          Property p;
            Boolean remotingFetch;
          Struct props = ignoreRemotingFetch?null:ComponentUtil.getPropertiesAsStruct(ci,false);
          Entry<Key, Object> e;
          Key k;
          while(it.hasNext()) {
            e = it.next();
            k = e.getKey();
                //String key=Caster.toString(it.next(),"");
                if(KeyConstants._THIS.equalsIgnoreCase(k))continue;
                if(!ignoreRemotingFetch) {
                  p=(Property) props.get(k,null);
                  if(p!=null) {
                    remotingFetch=Caster.toBoolean(p.getDynamicAttributes().get(REMOTING_FETCH,null),null);
                    if(remotingFetch==null){
                  if(isPeristent  && ORMUtil.isRelated(p)) continue;
                }
                else if(!remotingFetch.booleanValue()) continue;
                  }
View Full Code Here

          sb.append(goIn()+"<var scope=\"this\" name="+_+key.toString()+_+">");
            sb.append(_serialize(member,done));
            sb.append(goIn()+"</var>");
        }

        Property p;
        Boolean remotingFetch;
      Struct props = ignoreRemotingFetch?null:ComponentUtil.getPropertiesAsStruct(ca,false);
        ComponentScope scope = ca.getComponentScope();
        it=scope.keyIterator();
        while(it.hasNext()) {
          key=Caster.toKey(it.next(),null);
          if(!ignoreRemotingFetch) {
            p=(Property) props.get(key,null);
              if(p!=null) {
                remotingFetch=Caster.toBoolean(p.getDynamicAttributes().get(REMOTING_FETCH,null),null);
                if(remotingFetch==null){
              if(isPeristent  && ORMUtil.isRelated(p)) continue;
            }
            else if(!remotingFetch.booleanValue()) continue;
              }
View Full Code Here

          sb.append(goIn()+"<var scope=\"this\" name="+_+key.toString()+_+">");
            sb.append(_serialize(member,done));
            sb.append(goIn()+"</var>");
        }

        Property p;
        Boolean remotingFetch;
      Struct props = ignoreRemotingFetch?null:ComponentUtil.getPropertiesAsStruct(ca,false);
        ComponentScope scope = ca.getComponentScope();
        it=scope.keyIterator();
        while(it.hasNext()) {
          key=Caster.toKey(it.next(),null);
          if(!ignoreRemotingFetch) {
            p=(Property) props.get(key,null);
              if(p!=null) {
                remotingFetch=Caster.toBoolean(p.getDynamicAttributes().get(REMOTING_FETCH,null),null);
                if(remotingFetch==null){
              if(isPeristent  && ORMUtil.isRelated(p)) continue;
            }
            else if(!remotingFetch.booleanValue()) continue;
              }
View Full Code Here

    } catch (ClassException e) {
      throw Caster.toPageException(e);
    }
     
      //PageContext pc = ThreadLocalPageContext.get();
      Property p;
      Object v;
      Collection.Key k;
    CFMLExpressionInterpreter interpreter = new CFMLExpressionInterpreter();
      for(int i=0;i<props.length;i++){
        p=props[i];
        k=Caster.toKey(p.getName());
      // value
        v=scope.get(k,null);
        if(v==null)v=comp.get(k, null);
      // default
       
        if(v!=null)v=Caster.castTo(pc, p.getType(), v, false);
        else{
          if(!StringUtil.isEmpty(p.getDefault())){
            try {
              v=Caster.castTo(pc, p.getType(), p.getDefault(), false);
             
            }
              catch(PageException pe) {
                try {
                  v=interpreter.interpret(pc, p.getDefault());
                  v=Caster.castTo(pc, p.getType(), v, false);
                }
                  catch(PageException pe2) {
                  throw new ExpressionException("can not use default value ["+p.getDefault()+"] for property ["+p.getName()+"] with type ["+p.getType()+"]");
                  }
              }
          }
        }
       
      // set or throw
        if(v==null) {
          if(p.isRequired())throw new ExpressionException("required property ["+p.getName()+"] is not defined");
        }
        else {
          Reflector.callSetter(obj, p.getName().toLowerCase(), _toAxisType(tm,null,null,v,targetClass,done))
        }
      }
      return obj;
    }
View Full Code Here

                    cw.removeEL(keys[i]);
            }
           
           
            Property[] props = c.getProperties(false);
            Property prop;
            for(int i=0;i<props.length;i++){
              prop=props[i];
              try{
                cw.set(pc, KeyImpl.init(prop.getName()), toRailoType(pc,Reflector.callGetter(value, prop.getName())));
              }
              catch(PageException pe){
                pe.printStackTrace();
              }
            }
View Full Code Here

TOP

Related Classes of railo.runtime.component.Property

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.