* @param imessage
*/
private void convertMessageToFacesMessages(ValidatorMessageHolder imessage,
FacesContext facesContext, UIComponent component) {
if (imessage instanceof ValidatorMessage) {
ValidatorMessage message = (ValidatorMessage) imessage;
if (message.hasError()) {
throw new ValidatorException(
convertMessageToFacesMessage(message));
}
} else if (imessage instanceof ValidatorMessages) {
ValidatorMessages messages = (ValidatorMessages) imessage;
for (ValidatorMessage message : messages) {
if (message.hasError()) {
facesContext.addMessage(
component.getClientId(facesContext),
convertMessageToFacesMessage(message));
UIInput uiComponent = (UIInput) component;
uiComponent.setValid(false);