}
public void applyAttachedObject(FacesContext context, UIComponent parent)
{
// Retrieve the current FaceletContext from FacesContext object
FaceletContext faceletContext = (FaceletContext) context.getAttributes().get(
FaceletContext.FACELET_CONTEXT_KEY);
// cast to a ValueHolder
ValueHolder vh = (ValueHolder) parent;
ValueExpression ve = null;
Converter c = null;
if (_delegate.getBinding() != null)
{
ve = _delegate.getBinding().getValueExpression(faceletContext, Converter.class);
c = (Converter) ve.getValue(faceletContext);
}
if (c == null)
{
c = this.createConverter(faceletContext);
if (ve != null)
{
ve.setValue(faceletContext, c);
}
}
if (c == null)
{
throw new TagException(_delegate.getTag(), "No Converter was created");
}
_delegate.setAttributes(faceletContext, c);
vh.setConverter(c);
Object lv = vh.getLocalValue();
FacesContext faces = faceletContext.getFacesContext();
if (lv instanceof String)
{
vh.setValue(c.getAsObject(faces, parent, (String) lv));
}
}