Package railo.transformer.cfml.evaluator.func.impl

Source Code of railo.transformer.cfml.evaluator.func.impl.StructKeyExists

package railo.transformer.cfml.evaluator.func.impl;

import railo.runtime.exp.TemplateException;
import railo.runtime.type.Collection;
import railo.transformer.bytecode.expression.Expression;
import railo.transformer.bytecode.expression.type.CollectionKey;
import railo.transformer.bytecode.expression.var.Argument;
import railo.transformer.bytecode.expression.var.BIF;
import railo.transformer.bytecode.literal.LitString;
import railo.transformer.cfml.evaluator.FunctionEvaluator;
import railo.transformer.library.function.FunctionLibFunction;

public class StructKeyExists implements FunctionEvaluator{

  public void evaluate(BIF bif, FunctionLibFunction flf) throws TemplateException {
    Argument arg = bif.getArguments()[1];
    Expression value = arg.getValue();
    if(value instanceof LitString) {
      String str=((LitString)value).getString();
     
      // update first arg
      arg.setValue(new CollectionKey(str),Collection.Key.class.getName());
    }
    //print.out("bif:"+arg.getValue().getClass().getName());
  }

}
TOP

Related Classes of railo.transformer.cfml.evaluator.func.impl.StructKeyExists

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.