本文整理汇总了Java中net.fortuna.ical4j.model.property.Summary类的典型用法代码示例。如果您正苦于以下问题:Java Summary类的具体用法?Java Summary怎么用?Java Summary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Summary类属于net.fortuna.ical4j.model.property包,在下文中一共展示了Summary类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createCalendar
import net.fortuna.ical4j.model.property.Summary; //导入依赖的package包/类
public static Calendar createCalendar(CalDavEvent calDavEvent, DateTimeZone timeZone) {
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
TimeZone timezone = registry.getTimeZone(timeZone.getID());
Calendar calendar = new Calendar();
calendar.getProperties().add(Version.VERSION_2_0);
calendar.getProperties().add(new ProdId("openHAB"));
VEvent vEvent = new VEvent();
vEvent.getProperties().add(new Summary(calDavEvent.getName()));
vEvent.getProperties().add(new Description(calDavEvent.getContent()));
final DtStart dtStart = new DtStart(new net.fortuna.ical4j.model.DateTime(calDavEvent.getStart().toDate()));
dtStart.setTimeZone(timezone);
vEvent.getProperties().add(dtStart);
final DtEnd dtEnd = new DtEnd(new net.fortuna.ical4j.model.DateTime(calDavEvent.getEnd().toDate()));
dtEnd.setTimeZone(timezone);
vEvent.getProperties().add(dtEnd);
vEvent.getProperties().add(new Uid(calDavEvent.getId()));
vEvent.getProperties().add(Clazz.PUBLIC);
vEvent.getProperties()
.add(new LastModified(new net.fortuna.ical4j.model.DateTime(calDavEvent.getLastChanged().toDate())));
calendar.getComponents().add(vEvent);
return calendar;
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:25,代码来源:Util.java
示例2: getFreeBusyEvent
import net.fortuna.ical4j.model.property.Summary; //导入依赖的package包/类
private static VEvent getFreeBusyEvent(VEvent vEvent, String freeBusyText) {
try {
VEvent freeBusyEvent = new VEvent();
freeBusyEvent.getProperties().add(new Summary(freeBusyText));
for (String propertyName : FREE_BUSY_ALLOWED_PROPERTIES) {
Property property = vEvent.getProperty(propertyName);
if (property != null) {
freeBusyEvent.getProperties().add(property);
}
}
return freeBusyEvent;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
开发者ID:1and1,项目名称:cosmo,代码行数:17,代码来源:FreeBusyUtil.java
示例3: fromSummary
import net.fortuna.ical4j.model.property.Summary; //导入依赖的package包/类
protected static String fromSummary(PropertyList propertyList) {
Summary iCalObj = (Summary) propertyList.getProperty(Summary.SUMMARY);
if (iCalObj == null) {
return null;
}
return iCalObj.getValue();
}
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:8,代码来源:ICalConverter.java
示例4: convertedCalendarMatchesSubject
import net.fortuna.ical4j.model.property.Summary; //导入依赖的package包/类
@Test
public void convertedCalendarMatchesSubject() throws DatatypeConfigurationException{
CalendarItemType calendarItem = new CalendarItemType();
String randomSubject = RandomStringUtils.random(32);
calendarItem.setStart(DateHelp.convertDateToXMLGregorianCalendar(new Date()));
Duration duration = DatatypeFactory.newInstance().newDuration(1000 * 60 * 60);
XMLGregorianCalendar end = calendarItem.getStart();
end.add(duration);
calendarItem.setEnd(end);
calendarItem.setSubject(randomSubject);
log.info("created calendar item with subject="+randomSubject);
Calendar calendar = eventConverter.convertToCalendar(Collections.singleton(calendarItem), null);
//calendar should not be null
assertNotNull(calendar);
ComponentList components = calendar.getComponents();
//calendar should have components
assertNotNull(components);
//calendar should have exactly one component
assertEquals(1, components.size());
//components should be events
assertEquals(components, calendar.getComponents(VEvent.VEVENT));
Object object = components.get(0);
assertNotNull(object);
assertTrue(object instanceof VEvent);
VEvent event =(VEvent) object;
assertNotNull(event);
Summary summary = event.getSummary();
assertNotNull(summary);
assertNotNull(summary.getValue());
assertEquals(randomSubject, summary.getValue());
log.info("converted event summary["+summary.getValue()+"] matches calendar item sujbect["+calendarItem.getSubject()+"]");
}
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:41,代码来源:ExchangeEventConverterImplTest.java
示例5: toSummary
import net.fortuna.ical4j.model.property.Summary; //导入依赖的package包/类
protected static Summary toSummary(String javaObj) {
if (javaObj == null) {
return null;
}
return new Summary(javaObj);
}
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:7,代码来源:ICalConverter.java
示例6: createTestCalendar
import net.fortuna.ical4j.model.property.Summary; //导入依赖的package包/类
/**
* Creates test calendar instance.
*
* @return ICal calendar object.
*/
protected Calendar createTestCalendar() throws ParseException {
// Create a TimeZone
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
TimeZone timezone = registry.getTimeZone("America/New_York");
VTimeZone tz = timezone.getVTimeZone();
// Start Date is on: April 1, 2013, 9:00 am
java.util.Calendar startDate = new GregorianCalendar();
startDate.setTimeZone(timezone);
startDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
startDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
startDate.set(java.util.Calendar.YEAR, 2013);
startDate.set(java.util.Calendar.HOUR_OF_DAY, 17);
startDate.set(java.util.Calendar.MINUTE, 0);
startDate.set(java.util.Calendar.SECOND, 0);
// End Date is on: April 1, 2013, 13:00
java.util.Calendar endDate = new GregorianCalendar();
endDate.setTimeZone(timezone);
endDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
endDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
endDate.set(java.util.Calendar.YEAR, 2013);
endDate.set(java.util.Calendar.HOUR_OF_DAY, 21);
endDate.set(java.util.Calendar.MINUTE, 0);
endDate.set(java.util.Calendar.SECOND, 0);
// Create the event
PropertyList propertyList = new PropertyList();
propertyList.add(new DtStamp("20130324T180000Z"));
propertyList.add(new DtStart(new DateTime(startDate.getTime())));
propertyList.add(new DtEnd(new DateTime(endDate.getTime())));
propertyList.add(new Summary("Progress Meeting"));
VEvent meeting = new VEvent(propertyList);
// add timezone info..
meeting.getProperties().add(tz.getTimeZoneId());
// generate unique identifier..
meeting.getProperties().add(new Uid("00000000"));
// add attendees..
Attendee dev1 = new Attendee(URI.create("mailto:[email protected]"));
dev1.getParameters().add(Role.REQ_PARTICIPANT);
dev1.getParameters().add(new Cn("Developer 1"));
meeting.getProperties().add(dev1);
Attendee dev2 = new Attendee(URI.create("mailto:[email protected]"));
dev2.getParameters().add(Role.OPT_PARTICIPANT);
dev2.getParameters().add(new Cn("Developer 2"));
meeting.getProperties().add(dev2);
// Create a calendar
net.fortuna.ical4j.model.Calendar icsCalendar = new net.fortuna.ical4j.model.Calendar();
icsCalendar.getProperties().add(Version.VERSION_2_0);
icsCalendar.getProperties().add(new ProdId("-//Events Calendar//iCal4j 1.0//EN"));
icsCalendar.getProperties().add(CalScale.GREGORIAN);
// Add the event and print
icsCalendar.getComponents().add(meeting);
return icsCalendar;
}
开发者ID:HydAu,项目名称:Camel,代码行数:67,代码来源:ICalDataFormatTest.java
示例7: createTestCalendar
import net.fortuna.ical4j.model.property.Summary; //导入依赖的package包/类
private Calendar createTestCalendar() throws ParseException {
// Create a TimeZone
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
TimeZone timezone = registry.getTimeZone("America/New_York");
VTimeZone tz = timezone.getVTimeZone();
// Start Date is on: April 1, 2013, 9:00 am
java.util.Calendar startDate = new GregorianCalendar();
startDate.setTimeZone(timezone);
startDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
startDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
startDate.set(java.util.Calendar.YEAR, 2013);
startDate.set(java.util.Calendar.HOUR_OF_DAY, 17);
startDate.set(java.util.Calendar.MINUTE, 0);
startDate.set(java.util.Calendar.SECOND, 0);
// End Date is on: April 1, 2013, 13:00
java.util.Calendar endDate = new GregorianCalendar();
endDate.setTimeZone(timezone);
endDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
endDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
endDate.set(java.util.Calendar.YEAR, 2013);
endDate.set(java.util.Calendar.HOUR_OF_DAY, 21);
endDate.set(java.util.Calendar.MINUTE, 0);
endDate.set(java.util.Calendar.SECOND, 0);
// Create the event
PropertyList propertyList = new PropertyList();
propertyList.add(new DtStamp("20130324T180000Z"));
propertyList.add(new DtStart(new DateTime(startDate.getTime())));
propertyList.add(new DtEnd(new DateTime(endDate.getTime())));
propertyList.add(new Summary("Progress Meeting"));
VEvent meeting = new VEvent(propertyList);
// add timezone info..
meeting.getProperties().add(tz.getTimeZoneId());
// generate unique identifier..
meeting.getProperties().add(new Uid("00000000"));
// add attendees..
Attendee dev1 = new Attendee(URI.create("mailto:[email protected]"));
dev1.getParameters().add(Role.REQ_PARTICIPANT);
dev1.getParameters().add(new Cn("Developer 1"));
meeting.getProperties().add(dev1);
Attendee dev2 = new Attendee(URI.create("mailto:[email protected]"));
dev2.getParameters().add(Role.OPT_PARTICIPANT);
dev2.getParameters().add(new Cn("Developer 2"));
meeting.getProperties().add(dev2);
// Create a calendar
net.fortuna.ical4j.model.Calendar icsCalendar = new net.fortuna.ical4j.model.Calendar();
icsCalendar.getProperties().add(Version.VERSION_2_0);
icsCalendar.getProperties().add(new ProdId("-//Events Calendar//iCal4j 1.0//EN"));
icsCalendar.getProperties().add(CalScale.GREGORIAN);
// Add the event and print
icsCalendar.getComponents().add(meeting);
return icsCalendar;
}
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:62,代码来源:ICalFormatTest.java
注:本文中的net.fortuna.ical4j.model.property.Summary类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论