}
catch(IntrospectionException e){
throw raise(e);
}
if(!prop_elements.isEmpty()){
component = component.bindProperties(new PropertyBinder(){
public Creator bind(Class component_type, Object key, Class type) {
final Prop prop = (Prop)valnames.get(key);
if(prop!=null){
Component result = prop.getVal(type);
if(result==null){
result = Components.value(null);//Components.useProperty(component_type, key, type);
}
final Component def = prop.getDefault(type);
if(def!=null){
result = Monad.mplus(result, def);
}
else if(prop.isOptional()){
result = result.optional();
}
return result;
}
else return Components.useProperty(component_type, key, type);
}
});
}
if(optional_properties){
component = component.optionalProperties();
}
final PropertyBinder autowiring = getPropertyAutowireMode();
if(autowiring!=null){
component = component.bindProperties(autowiring);
}
return component;
}