if (child == null) {
throw new NullPointerException(getMessages()
.getMessage("clay.null.childComponent"));
}
ComponentBean displayElement = clayContext.getDisplayElement();
if (displayElement == null) {
throw new NullPointerException(getMessages()
.getMessage("clay.null.componentBean"));
}
ValueHolder parent = (ValueHolder) clayContext.getParent();
if (parent == null) {
throw new NullPointerException(getMessages()
.getMessage("clay.null.parentComponent"));
}
FacesContext facesContext = clayContext.getFacesContext();
if (facesContext == null) {
throw new NullPointerException(getMessages()
.getMessage("clay.null.facesContext"));
}
Converter converter = null;
try {
AttributeBean attr = displayElement.getAttribute("binding");
if (attr != null && isValueReference(attr.getValue())) {
clayContext.setAttribute(attr);
String expr = replaceMnemonic(clayContext);
ValueBinding vb = facesContext.getApplication().createValueBinding(expr);
converter = (Converter) vb.getValue(facesContext);
} else {
// the default converter id comes for the component type
String converterId = displayElement.getComponentType();
// check for a converterId attribute override
attr = displayElement.getAttribute("converterId");
if (attr != null && attr.getValue() != null
&& attr.getValue().length() > 0) {
clayContext.setAttribute(attr);
String tmp = getTagUtils().evalString(replaceMnemonic(clayContext));
if (tmp != null && tmp.length() > 0) {