001 package railo.transformer.cfml.evaluator.func.impl; 002 003 import railo.runtime.exp.TemplateException; 004 import railo.runtime.type.Collection; 005 import railo.transformer.bytecode.expression.Expression; 006 import railo.transformer.bytecode.expression.type.CollectionKey; 007 import railo.transformer.bytecode.expression.var.Argument; 008 import railo.transformer.bytecode.expression.var.BIF; 009 import railo.transformer.bytecode.literal.LitString; 010 import railo.transformer.cfml.evaluator.FunctionEvaluator; 011 import railo.transformer.library.function.FunctionLibFunction; 012 013 public class StructKeyExists implements FunctionEvaluator{ 014 015 public void evaluate(BIF bif, FunctionLibFunction flf) throws TemplateException { 016 Argument arg = bif.getArguments()[1]; 017 Expression value = arg.getValue(); 018 if(value instanceof LitString) { 019 String str=((LitString)value).getString(); 020 021 // update first arg 022 arg.setValue(new CollectionKey(str,-1),Collection.Key.class.getName()); 023 } 024 //print.out("bif:"+arg.getValue().getClass().getName()); 025 } 026 027 }