public class CSVParser extends BaseParser
This parser can be accessed using "csv" for SubstitutionScheduleData.setApi(String).
SubstitutionScheduleData.setData(JSONObject) to configure the parser:
url (String, required)separator (String, required)",", ";" or "\t")columns (Array of Strings, required)"lesson", "subject",
"previousSubject", "type", "type-entfall", "room", "previousRoom", "teacher", "previousTeacher", desc",
"desc-type", "class", "day", "stand", "ignore"classes (Array of Strings, required if classesUrl not specified)website (String, recommended)skipLines (Integer, optional)0classesUrl (String, optional)classRegex (String, optional)getSubstitutionSchedule(), not
getAllClasses(). The RegEx is matched against the class using Matcher.find(). If the RegEx
contains a group, the content of the first group Matcher.group(int) is used as the resulting class.
Otherwise, Matcher.group() is used. If the RegEx cannot be matched (Matcher.find() returns
false), the class is set to an empty string.
LoginHandler for login-protected schedules.colorProvider, cookieProvider, cookieStore, credential, encodingDetector, executor, PARAM_CLASS_REGEX, scheduleData| Constructor and Description |
|---|
CSVParser(SubstitutionScheduleData scheduleData,
CookieProvider cookieProvider) |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getAllClasses()
Get a list of all available classes.
|
List<String> |
getAllTeachers()
Get a list of all available teachers.
|
SubstitutionSchedule |
getSubstitutionSchedule()
Downloads and parses the substitution schedule
|
contains, getClassesFromJson, getCredential, getInstance, httpGet, httpGet, httpPost, httpPost, httpPost, httpPost, recognizeType, setCredentialpublic CSVParser(SubstitutionScheduleData scheduleData, CookieProvider cookieProvider)
public SubstitutionSchedule getSubstitutionSchedule() throws IOException, org.json.JSONException, CredentialInvalidException
BaseParsergetSubstitutionSchedule in interface SubstitutionScheduleParsergetSubstitutionSchedule in class BaseParserSubstitutionScheduleIOException - Connection or parsing errororg.json.JSONException - Error with the JSON configurationCredentialInvalidException - the supplied credential (BaseParser.setCredential(Credential) is
not correctpublic List<String> getAllClasses() throws IOException, org.json.JSONException
BaseParsergetAllClasses in class BaseParserIOException - Connection or parsing errororg.json.JSONException - Error with the JSON configurationpublic List<String> getAllTeachers()
BaseParsernull.getAllTeachers in class BaseParser