public TimerDefinitionImpl parseTimerEventDefinition(Element timerEventDefinitionElement, Parse parse, String eventId) {
Element timeDate = XmlUtil.element(timerEventDefinitionElement, "timeDate");
Element timeCycle = XmlUtil.element(timerEventDefinitionElement, "timeCycle");
if ( (timeDate != null && timeCycle != null)
|| (timeDate == null && timeCycle == null) ) {
parse.addProblem("timerEventDefinition for event '" + eventId +
"' requires either a timeDate or a timeCycle definition (but not both)");
return null;
}
TimerDefinitionImpl timerDefinition = new TimerDefinitionImpl();
if (timeDate != null) {
parseTimeDate(eventId, parse, timeDate, timerDefinition);
}
if (timeCycle != null) {
parseTimeCycle(eventId, parse, timeCycle, timerDefinition);
}
return timerDefinition;
}