code: public String getErrorAndRequiredClass(UIInput input, String clientId) {
  		String[] levels = { "bf-no-message", "bf-info", "bf-warning", "bf-error", "bf-fatal" };
  		int level = 0;
  		Iterator<FacesMessage> messages = FacesContext.getCurrentInstance().getMessages(clientId);
  		if (null != messages) {
  			while (messages.hasNext()) {
  				FacesMessage message = messages.next();
  				if (message.getSeverity().equals(FacesMessage.SEVERITY_INFO))
  					if (level < 1)
  						level = 1;
  				if (message.getSeverity().equals(FacesMessage.SEVERITY_WARN))
  					if (level < 2)
  						level = 2;
  				if (message.getSeverity().equals(FacesMessage.SEVERITY_ERROR))
  					if (level < 3)
  						level = 3;
  				if (message.getSeverity().equals(FacesMessage.SEVERITY_FATAL))
  					if (level < 4)
  						level = 4;
  			}
  		}
  		String styleClass = levels[level];
  		if (input.isRequired()) {
  			styleClass += " bf-required";
  		}
  		return styleClass;
  	}
docs: Yields the value of the required and error level CSS class.
  
  @param input
  @param clientId
  @return