code: public void validate(FacesContext facesContext, UIComponent uiComponent,
              Object value) throws ValidatorException
      {
          if (facesContext == null)
          {
              throw new NullPointerException("facesContext");
          }
          if (uiComponent == null)
          {
              throw new NullPointerException("uiComponent");
          }
  
          //Check if the value is empty like UIInput.validateValue
          boolean empty = value == null
                  || (value instanceof String && ((String) value).length() == 0);
  
          if (empty)
          {
              if (uiComponent instanceof UIInput)
              {
                  UIInput uiInput = (UIInput) uiComponent;
                  if (uiInput.getRequiredMessage() != null)
                  {
                      String requiredMessage = uiInput.getRequiredMessage();
                      throw new ValidatorException(new FacesMessage(
                              FacesMessage.SEVERITY_ERROR, requiredMessage,
                              requiredMessage));
                  }
              }
              throw new ValidatorException(_MessageUtils.getMessage(facesContext,
                      facesContext.getViewRoot().getLocale(),
                      FacesMessage.SEVERITY_ERROR, UIInput.REQUIRED_MESSAGE_ID,
                      new Object[] { _MessageUtils.getLabel(facesContext,
                              uiComponent) }));
          }
      }
docs: VALIDATE