Package org.cesilko.rachota.core
Class DiaryScanner
- java.lang.Object
-
- org.cesilko.rachota.core.DiaryScanner
-
public class DiaryScanner extends java.lang.ObjectThis is a DOM tree scanner of diary XML files.
-
-
Constructor Summary
Constructors Constructor Description DiaryScanner(org.w3c.dom.Document document)Creates new diary scanner.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcreateDTD()Creates diary.dtd file that is used for automatic XML validation of diary files.private booleanloadAutomaticStart(org.w3c.dom.Element notificationElement)Loads automatic start option from given XML element.private voidloadDay(org.w3c.dom.Element dayElement, int week_id, int week_year)Loads day from given XML element.private java.lang.StringloadDescription(org.w3c.dom.Element descriptionElement)Loads description from given XML element.voidloadDocument()Loads XML diary document given in the scanner constructor.private java.lang.StringloadKeyword(org.w3c.dom.Element keywordElement)Loads keyword from given XML element.private java.lang.StringloadNotes(org.w3c.dom.Element notesElement)Loads notes from given XML element.private longloadNotification(org.w3c.dom.Element notificationElement)Loads notification time from given XML element.private intloadPriority(org.w3c.dom.Element priorityElement)Loads priority from given XML element.private intloadRepetition(org.w3c.dom.Element repetitionElement)Loads repetition from given XML element.private TaskloadTask(org.w3c.dom.Element taskElement)Loads task from given XML element.private voidloadWeek(org.w3c.dom.Element element)Loads week from given XML element.
-
-
-
Method Detail
-
loadDocument
public void loadDocument()
Loads XML diary document given in the scanner constructor.
-
loadWeek
private void loadWeek(org.w3c.dom.Element element)
Loads week from given XML element.- Parameters:
element- XML element representing a week.
-
loadDay
private void loadDay(org.w3c.dom.Element dayElement, int week_id, int week_year)Loads day from given XML element.- Parameters:
dayElement- XML element representing a week.week_id- Number of week to which this day belongs.week_year- Number of year to which this day belongs.
-
loadTask
private Task loadTask(org.w3c.dom.Element taskElement)
Loads task from given XML element.- Parameters:
taskElement- XML element representing a task.- Returns:
- Task loaded from given XML element.
-
loadPriority
private int loadPriority(org.w3c.dom.Element priorityElement)
Loads priority from given XML element.- Parameters:
priorityElement- XML element representing a priority.- Returns:
- Priority loaded from given XML element.
-
loadDescription
private java.lang.String loadDescription(org.w3c.dom.Element descriptionElement)
Loads description from given XML element.- Parameters:
descriptionElement- XML element representing a description.- Returns:
- Description loaded from given XML element.
-
loadKeyword
private java.lang.String loadKeyword(org.w3c.dom.Element keywordElement)
Loads keyword from given XML element.- Parameters:
keywordElement- XML element representing a keyword.- Returns:
- Keyword loaded from given XML element.
-
loadNotes
private java.lang.String loadNotes(org.w3c.dom.Element notesElement)
Loads notes from given XML element.- Parameters:
notesElement- XML element representing a notes.- Returns:
- Notes loaded from given XML element.
-
loadNotification
private long loadNotification(org.w3c.dom.Element notificationElement)
Loads notification time from given XML element.- Parameters:
notificationElement- XML element representing a notification time.- Returns:
- Notification time loaded from given XML element.
-
loadAutomaticStart
private boolean loadAutomaticStart(org.w3c.dom.Element notificationElement)
Loads automatic start option from given XML element.- Parameters:
notificationElement- XML element representing a notification time.- Returns:
- Automatic start option loaded from given XML element.
-
loadRepetition
private int loadRepetition(org.w3c.dom.Element repetitionElement)
Loads repetition from given XML element.- Parameters:
repetitionElement- XML element representing a repetition.- Returns:
- Repetition loaded from given XML element.
-
createDTD
public static void createDTD()
Creates diary.dtd file that is used for automatic XML validation of diary files.
-
-