@Override protected ExceptionDates _parseJson( JCalValue value, ICalDataType dataType, ICalParameters parameters, ParseContext context) { List<String> valueStrs = value.asMulti(); ExceptionDates property = new ExceptionDates(); for (String valueStr : valueStrs) { ICalDate date = readValue(property, valueStr, dataType, parameters, context); property.addValue(date); } return property; }
@Override protected JCalValue _writeJson(ExceptionDates property, WriteContext context) { List<ICalDate> values = property.getValues(); if (values.isEmpty()) { return JCalValue.single(""); } List<String> valuesStr = new ArrayList<String>(); if (isInObservance(context)) { for (ICalDate value : values) { String valueStr = date(value).observance(true).extended(true).write(); valuesStr.add(valueStr); } return JCalValue.multi(valuesStr); } for (ICalDate value : values) { String dateStr = date(value, property, context).extended(true).write(); valuesStr.add(dateStr); } return JCalValue.multi(valuesStr); }