public class DaVinciParser extends BaseParser
This parser can be accessed using "davinci"
for SubstitutionScheduleData.setApi(String)
.
SubstitutionScheduleData.setData(JSONObject)
to configure the parser:
url
(String, required)classes
(Array of Strings, required if classesSource
not specified)classesSource
(String, optional)embeddedContentSelector
(String, optional)LoginHandler
for login-protected schedules.Modifier and Type | Field and Description |
---|---|
static String |
PARAM_EMBEDDED_CONTENT_SELECTOR |
colorProvider, cookieProvider, cookieStore, credential, executor, PARAM_CLASS_REGEX, scheduleData
Constructor and Description |
---|
DaVinciParser(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, setCredential
public static final String PARAM_EMBEDDED_CONTENT_SELECTOR
public DaVinciParser(SubstitutionScheduleData scheduleData, CookieProvider cookieProvider)
public SubstitutionSchedule getSubstitutionSchedule() throws IOException, org.json.JSONException, CredentialInvalidException
BaseParser
getSubstitutionSchedule
in interface SubstitutionScheduleParser
getSubstitutionSchedule
in class BaseParser
SubstitutionSchedule
IOException
- 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
BaseParser
getAllClasses
in class BaseParser
IOException
- Connection or parsing errororg.json.JSONException
- Error with the JSON configurationpublic List<String> getAllTeachers()
BaseParser
null
.getAllTeachers
in class BaseParser