}
pattern.setId(id);
pattern.setCode(code);
pattern.setWeight(weight);
int patternEntryIndex = 0;
DayOfWeek firstDayOfweek = null;
for (Element patternEntryElement : patternEntryElementList) {
assertElementName(patternEntryElement, "PatternEntry");
Element shiftTypeElement = patternEntryElement.getChild("ShiftType");
boolean shiftTypeIsNone;
ShiftType shiftType;
if (shiftTypeElement.getText().equals("Any")) {
shiftTypeIsNone = false;
shiftType = null;
} else if (shiftTypeElement.getText().equals("None")) {
shiftTypeIsNone = true;
shiftType = null;
} else {
shiftTypeIsNone = false;
shiftType = shiftTypeMap.get(shiftTypeElement.getText());
if (shiftType == null) {
throw new IllegalArgumentException("The shiftType (" + shiftTypeElement.getText()
+ ") of pattern (" + pattern.getCode() + ") does not exist.");
}
}
Element dayElement = patternEntryElement.getChild("Day");
DayOfWeek dayOfWeek;
if (dayElement.getText().equals("Any")) {
dayOfWeek = null;
} else {
dayOfWeek = DayOfWeek.valueOfCode(dayElement.getText());
if (dayOfWeek == null) {