/**
   * Parses and returns the lookup result set limit, checking first for the limit for the specific
   * view, then the class being looked up, and then the global application limit if there isn't a
   * limit specific to this data object class.
   *
   * @param dataObjectClass - class to get limit for
   * @param lookupForm - LookupForm to use. May be null if the form is unknown. If lookupForm is
   *     null, only the dataObjectClass will be used to find the search results set limit
   * @return result set limit
   */
  public static Integer getSearchResultsLimit(Class dataObjectClass, LookupForm lookupForm) {
    Integer limit =
        KRADServiceLocatorWeb.getViewDictionaryService()
            .getResultSetLimitForLookup(dataObjectClass, lookupForm);
    if (limit == null) {
      limit = getApplicationSearchResultsLimit();
    }

    return limit;
  }