public ASelectableCondition loadCondition(final XMLElement element) {
try {
if (element.getName().equalsIgnoreCase(TimeConditionCreatedBefore.NAME)) {
final String dateString = element.getAttribute(TimeCondition.DATE, null);
FormattedDate date = FormattedDate.createDefaultFormattedDate(Long.parseLong(dateString), IFormattedObject.TYPE_DATETIME);
return new TimeConditionCreatedBefore(date);
}
if (element.getName().equalsIgnoreCase(TimeConditionCreatedAfter.NAME)) {
final String dateString = element.getAttribute(TimeCondition.DATE, null);
FormattedDate date = FormattedDate.createDefaultFormattedDate(Long.parseLong(dateString), IFormattedObject.TYPE_DATETIME);
return new TimeConditionCreatedAfter(date);
}
if (element.getName().equalsIgnoreCase(TimeConditionModifiedBefore.NAME)) {
final String dateString = element.getAttribute(TimeCondition.DATE, null);
FormattedDate date = FormattedDate.createDefaultFormattedDate(Long.parseLong(dateString), IFormattedObject.TYPE_DATETIME);
return new TimeConditionModifiedBefore(date);
}
if (element.getName().equalsIgnoreCase(TimeConditionModifiedAfter.NAME)) {
final String dateString = element.getAttribute(TimeCondition.DATE, null);
FormattedDate date = FormattedDate.createDefaultFormattedDate(Long.parseLong(dateString), IFormattedObject.TYPE_DATETIME);
return new TimeConditionModifiedAfter(date);
}
}
catch (final Exception e) {
LogUtils.severe(e);