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