code: public TableDefinition getTableDef(ApplicationDefinition appDef) {
          assert appDef != null;
          String table = getVariableDecoded("table");
          if (Utils.isEmpty(table)) {
              throw new RuntimeException("Missing {table} variable");
          }
          TableDefinition tableDef = m_appDef.getTableDef(table);
          if (tableDef == null) {
              throw new IllegalArgumentException("Unknown table for application '" + m_appDef.getAppName() + "': " + table);
          }
          return tableDef;
      }
docs: Convenience method that gets the {@link TableDefinition} of the table defined by
  the decoded "{table}" variable in the current request from the given application
  definition. If the given table is not found, an IllegalArgumentException is thrown
  so the REST API can turn it into a 400 Bad Request response.
  
  @param  appDef   {@link ApplicationDefinition} of application to get table for.
  @return          {@link TableDefinition} of table. Won't be null since an exception
  is thrown if the table isn't found.