@Test public void testGetClassesRegex() throws Exception { final JSONObject data = new JSONObject(); data.put(UntisInfoParser.PARAM_CLASS_SELECT_REGEX, "\\d+"); List<String> classes = UntisInfoParser.parseClasses(html, data); assertEquals(Arrays.asList( new String[]{"2", "UAEG", "SL", "VW", "PB", "1", "13", "12", "11", "10", "10", "10", "10", "10", "09", "09", "09", "09", "08", "08", "08", "08", "08", "08", "07", "07", "07", "07", "07", "07", "06", "06", "06", "06", "06", "06", "05", "05", "05", "05", "05", "ESL"}), classes); }
@NotNull static List<String> parseClasses(String navbarDoc, JSONObject data) throws JSONException, IOException { Pattern pattern = Pattern.compile("var classes = (\\[[^\\]]*\\]);"); return parseJsonList(navbarDoc, data, pattern); }
UntisInfoParser extends UntisCommonParser { @NotNull static List<String> parseClasses(String navbarDoc, JSONObject data) throws JSONException, IOException { Pattern pattern = Pattern.compile("var classes = (\\[[^\\]]*\\]);"); return parseJsonList(navbarDoc, data, pattern); } }
UntisInfoParser extends UntisCommonParser { @NotNull static List<String> parseClasses(String navbarDoc, JSONObject data) throws JSONException, IOException { Pattern pattern = Pattern.compile("var classes = (\\[[^\\]]*\\]);"); return parseJsonList(navbarDoc, data, pattern); } UntisInfoParser(SubstitutionScheduleData scheduleData, CookieProvider cookieProvider); }
UntisInfoParser extends UntisCommonParser { @NotNull static List<String> parseClasses(String navbarDoc, JSONObject data) throws JSONException, IOException { Pattern pattern = Pattern.compile("var classes = (\\[[^\\]]*\\]);"); return parseJsonList(navbarDoc, data, pattern); } UntisInfoParser(SubstitutionScheduleData scheduleData, CookieProvider cookieProvider); @Override SubstitutionSchedule getSubstitutionSchedule(); @Override List<String> getAllClasses(); @Override List<String> getAllTeachers(); }
UntisInfoParser extends UntisCommonParser { @NotNull static List<String> parseClasses(String navbarDoc, JSONObject data) throws JSONException, IOException { Pattern pattern = Pattern.compile("var classes = (\\[[^\\]]*\\]);"); return parseJsonList(navbarDoc, data, pattern); } UntisInfoParser(SubstitutionScheduleData scheduleData, CookieProvider cookieProvider); @Override SubstitutionSchedule getSubstitutionSchedule(); @Override List<String> getAllClasses(); @Override List<String> getAllTeachers(); static final String PARAM_BASEURL; static final String PARAM_CLASS_SELECT_REGEX; static final String PARAM_REMOVE_NON_MATCHING_CLASSES; static final String PARAM_W_AFTER_NUMBER; }