* javax.faces.component.UIComponent)
*/
public final void apply(FaceletContext ctx, UIComponent parent)
throws IOException, FacesException, FaceletException, ELException {
if (parent == null || !(parent instanceof ValueHolder)) {
throw new TagException(this.tag,
"Parent not an instance of ValueHolder: " + parent);
}
// only process if it's been created
if (parent.getParent() == null) {
// cast to a ValueHolder
ValueHolder vh = (ValueHolder) parent;
ValueExpression ve = null;
Converter c = null;
if (this.binding != null) {
ve = this.binding.getValueExpression(ctx, Converter.class);
c = (Converter) ve.getValue(ctx);
}
if (c == null) {
c = this.createConverter(ctx);
if (ve != null) {
ve.setValue(ctx, c);
}
}
if (c == null) {
throw new TagException(this.tag, "No Converter was created");
}
this.setAttributes(ctx, c);
vh.setConverter(c);
Object lv = vh.getLocalValue();
FacesContext faces = ctx.getFacesContext();