@Override protected String _writeText(Transparency property, WriteContext context) { if (context.getVersion() == ICalVersion.V1_0) { if (property.isOpaque()) { return "0"; } if (property.isTransparent()) { return "1"; } } return super._writeText(property, context); }
@Override protected ICalParameters _prepareParameters(ExceptionDates property, WriteContext context) { if (isInObservance(context)) { return property.getParameters(); } boolean hasTime; if (property.getValues().isEmpty()) { hasTime = false; } else { hasTime = (dataType(property, context.getVersion()) == DATE_TIME); } return handleTzidParameter(property, hasTime, context); }
@Override protected void _writeXml(ExceptionDates property, XCalElement element, WriteContext context) { List<ICalDate> values = property.getValues(); if (values.isEmpty()) { element.append(defaultDataType(context.getVersion()), ""); return; } if (isInObservance(context)) { for (ICalDate value : values) { String valueStr = date(value).observance(true).extended(true).write(); element.append(DATE_TIME, valueStr); } return; } for (ICalDate value : values) { ICalDataType dataType = value.hasTime() ? DATE_TIME : DATE; String dateStr = date(value, property, context).extended(true).write(); element.append(dataType, dateStr); } }