}
return cmpInfo;
}
private YComponent getOrCreateYComponent(YComponentInfo cmpInfo) {
YComponent cmp = null;
// retrieve passed value (ycomponent instance)
ValueExpression binding = getYComponentBinding();
Object _cmp = binding != null ? binding.getValue(getFacesContext().getELContext()) : null;
// when no value was passed...
if (_cmp == null) {
// create default implementation
cmp = cmpInfo.createDefaultComponent();
// only has an affect when component is backed by a writable
// ValueBinding
this.setValue(cmp);
} else {
Set<ERROR_STATE> errors = cmpInfo.assertCustomImplementationClass(_cmp.getClass());
if (!errors.isEmpty()) {
throw new YFacesException(ERROR_STATE.getFormattedErrorMessage(errors, cmpInfo,
_cmp.getClass()));
}
cmp = (YComponent) _cmp;
// When created via a Frame a YComponent has per default no ID
// in that case use UIComponent id (the unchanged one before
// duplicate check)
if (cmp.getId() == null) {
((AbstractYComponent) cmp).setId(getId());
}
log.debug(logId + "found valid Component (" + cmp.getClass().getSimpleName() + ")");
}
return cmp;
}