本文整理汇总了Java中net.fortuna.ical4j.model.component.VEvent.getUid方法的典型用法代码示例。如果您正苦于以下问题:Java VEvent.getUid方法的具体用法?Java VEvent.getUid怎么用?Java VEvent.getUid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.fortuna.ical4j.model.component.VEvent
的用法示例。
在下文中一共展示了VEvent.getUid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setCalendarAttributes
import net.fortuna.ical4j.model.component.VEvent; //导入方法依赖的package包/类
/**
* Sets calendar attributes.
* @param note The note item.
* @param event The event.
*/
private void setCalendarAttributes(NoteItem note, VEvent event) {
// UID (only set if master)
if(event.getUid()!=null && note.getModifies()==null) {
note.setIcalUid(event.getUid().getValue());
}
// for now displayName is limited to 1024 chars
if (event.getSummary() != null) {
note.setDisplayName(StringUtils.substring(event.getSummary()
.getValue(), 0, 1024));
}
if (event.getDescription() != null) {
note.setBody(event.getDescription().getValue());
}
// look for DTSTAMP
if(event.getDateStamp()!=null) {
note.setClientModifiedDate(event.getDateStamp().getDate());
}
// look for absolute VALARM
VAlarm va = ICalendarUtils.getDisplayAlarm(event);
if (va != null && va.getTrigger()!=null) {
Trigger trigger = va.getTrigger();
Date reminderTime = trigger.getDateTime();
if (reminderTime != null) {
note.setReminderTime(reminderTime);
}
}
// calculate triage status based on start date
java.util.Date now =java.util.Calendar.getInstance().getTime();
Date eventStartDate = event.getStartDate() != null && event.getStartDate().getDate() != null
? event.getStartDate().getDate()
:new Date();
boolean later = eventStartDate.after(now);
int code = later ? TriageStatus.CODE_LATER : TriageStatus.CODE_DONE;
TriageStatus triageStatus = note.getTriageStatus();
// initialize TriageStatus if not present
if (triageStatus == null) {
triageStatus = TriageStatusUtil.initialize(entityFactory
.createTriageStatus());
note.setTriageStatus(triageStatus);
}
triageStatus.setCode(code);
// check for X-OSAF-STARRED
if ("TRUE".equals(ICalendarUtils.getXProperty(X_OSAF_STARRED, event))) {
TaskStamp ts = StampUtils.getTaskStamp(note);
if (ts == null) {
note.addStamp(entityFactory.createTaskStamp());
}
}
}