code: public static final DataGridStateFactory getInstance(ServletRequest request) {
          Object obj = request.getAttribute(KEY);
          if(obj != null) {
              assert obj instanceof DataGridStateFactory;
              return (DataGridStateFactory)obj;
          }
          else {
              DataGridStateFactory factory = new DataGridStateFactory(request);
              request.setAttribute(KEY, factory);
              return factory;
          }
      }
docs: Get an instance of a DataGridStateFactory given a {@link ServletRequest}.
  
  @param request the current {@link ServletRequest}
  @return an instance of the factory