本文整理汇总了Java中net.fortuna.ical4j.model.parameter.Value类的典型用法代码示例。如果您正苦于以下问题:Java Value类的具体用法?Java Value怎么用?Java Value使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Value类属于net.fortuna.ical4j.model.parameter包,在下文中一共展示了Value类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getRecurrenceDates
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
private DateList getRecurrenceDates(Component event) {
DateList l = null;
if(event==null) {
return null;
}
for (Object property : event.getProperties().getProperties(Property.RDATE)) {
RDate rdate = (RDate) property;
if(l==null) {
if(Value.DATE.equals(rdate.getParameter(Parameter.VALUE))) {
l = new DateList(Value.DATE);
}
else {
l = new DateList(Value.DATE_TIME, rdate.getDates().getTimeZone());
}
}
l.addAll(rdate.getDates());
}
return l;
}
开发者ID:ksokol,项目名称:carldav,代码行数:23,代码来源:EntityConverter.java
示例2: ICalDate
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
/**
* Constructs an <code>ICalDate</code> from an iCalendar date.
* @param date The date.
* @throws UnknownTimeZoneException - if something is wrong this exception is thrown.
*/
public ICalDate(Date date) throws UnknownTimeZoneException {
if (date instanceof DateTime) {
value = Value.DATE_TIME;
tz = ((DateTime) date).getTimeZone();
// We only support known tzids (Olson for the most part)
if (tz != null) {
tz = tzTranslator.translateToOlsonTz(tz);
// If timezone can't be translated, then datetime will
// essentiallyi be floating.
if (tz != null) {
String id = tz.getVTimeZone().getProperties().
getProperty(Property.TZID).getValue();
tzid = new TzId(id);
}
}
} else {
value = Value.DATE;
}
this.anytime = false;
text = date.toString();
this.date = date;
}
开发者ID:1and1,项目名称:cosmo,代码行数:28,代码来源:ICalDate.java
示例3: setDatePropertyValue
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
protected void setDatePropertyValue(DateProperty prop,
Date date) {
if (prop == null) {
return;
}
Value value = (Value)
prop.getParameters().getParameter(Parameter.VALUE);
if (value != null) {
prop.getParameters().remove(value);
}
// Add VALUE=DATE for Date values, otherwise
// leave out VALUE=DATE-TIME because it is redundant
if(! (date instanceof DateTime)) {
prop.getParameters().add(Value.DATE);
}
}
开发者ID:1and1,项目名称:cosmo,代码行数:18,代码来源:HibBaseEventStamp.java
示例4: setDisplayAlarmTriggerDate
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
public void setDisplayAlarmTriggerDate(DateTime triggerDate) {
VAlarm alarm = getDisplayAlarm();
if(alarm==null) {
return;
}
Trigger oldTrigger = (Trigger) alarm.getProperties().getProperty(
Property.TRIGGER);
if (oldTrigger != null) {
alarm.getProperties().remove(oldTrigger);
}
Trigger newTrigger = new Trigger();
newTrigger.getParameters().add(Value.DATE_TIME);
newTrigger.setDateTime(triggerDate);
alarm.getProperties().add(newTrigger);
}
开发者ID:1and1,项目名称:cosmo,代码行数:19,代码来源:HibBaseEventStamp.java
示例5: testParseDateList
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
/**
* Tests parse date list.
* @throws Exception - if something is wrong this exception is thrown.
*/
@Test
public void testParseDateList() throws Exception {
String str = ";VALUE=DATE:20021010,20021011,20021012";
DateList dl = new ICalDate(str).getDateList();
Assert.assertNotNull("null date list", dl);
Assert.assertEquals("wrong number of dates", 3, dl.size());
Assert.assertNull("not null timezone", dl.getTimeZone());
Assert.assertEquals("not date", Value.DATE, dl.getType());
Assert.assertEquals("incorrect date", "20021010", dl.get(0).toString());
Assert.assertEquals("incorrect date", "20021011", dl.get(1).toString());
Assert.assertEquals("incorrect date", "20021012", dl.get(2).toString());
}
开发者ID:1and1,项目名称:cosmo,代码行数:21,代码来源:ICalDateTest.java
示例6: setDatePropertyValue
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
/**
* Sets date property value
* @param prop The date property.
* @param date The date.
*/
protected void setDatePropertyValue(DateProperty prop, Date date) {
if (prop == null) {
return;
}
Value value = (Value) prop.getParameters()
.getParameter(Parameter.VALUE);
if (value != null) {
prop.getParameters().remove(value);
}
// Add VALUE=DATE for Date values, otherwise
// leave out VALUE=DATE-TIME because it is redundant
if (!(date instanceof DateTime)) {
prop.getParameters().add(Value.DATE);
}
}
开发者ID:1and1,项目名称:cosmo,代码行数:22,代码来源:MockBaseEventStamp.java
示例7: setDisplayAlarmTriggerDate
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
/**
* Sets display alarm trigger date.
* @param triggerDate The trigger date.
*/
public void setDisplayAlarmTriggerDate(DateTime triggerDate) {
VAlarm alarm = getDisplayAlarm();
if (alarm == null) {
return;
}
Trigger oldTrigger = (Trigger) alarm.getProperties().getProperty(Property.TRIGGER);
if (oldTrigger != null) {
alarm.getProperties().remove(oldTrigger);
}
Trigger newTrigger = new Trigger();
newTrigger.getParameters().add(Value.DATE_TIME);
newTrigger.setDateTime(triggerDate);
alarm.getProperties().add(newTrigger);
}
开发者ID:1and1,项目名称:cosmo,代码行数:21,代码来源:MockBaseEventStamp.java
示例8: getRecurrenceIDList
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
/**
* Get a List of RECURRENCE-ID by recurrence dates and EXDATEs
*
* @param recurDates
* @param exDates
* @param value decide the format of RECURRENCE-ID
* @return
*/
public ArrayList<String> getRecurrenceIDList(DateList recurDates, DateList exDates, Value value) throws ParseException{
ArrayList<String> recurIdList= new ArrayList<String>();
// Date
if( value == Value.DATE ){
fillRecurIDListbyDate(recurIdList, recurDates);
}
// DateTime
else{
fillRecurIDListbyDateTime(recurIdList, recurDates);
}
// remove the exdates
if( exDates != null ){
if( value == Value.DATE ){
removeRecurIDListbyDate(recurIdList, exDates);
}
else{
removeRecurIDListbyDateTime(recurIdList, exDates);
}
}
return recurIdList;
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:32,代码来源:EventResource.java
示例9: recurTests
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
@Test
public void recurTests()
{
final TimeZone timeZone = DateHelper.EUROPE_BERLIN;
final Recur recur = new Recur();
recur.setFrequency(ICal4JUtils.getCal4JFrequencyString(RecurrenceFrequency.WEEKLY));
recur.setUntil(getDate("2013-01-31", timeZone));
recur.setInterval(2);
final DateList dateList = recur.getDates(getDate("2013-01-01", timeZone), getDate("2012-01-02", timeZone),
getDate("2013-03-31", timeZone), Value.TIME);
Assert.assertEquals(3, dateList.size());
final DateFormat df = new SimpleDateFormat(DateFormats.ISO_TIMESTAMP_MINUTES);
df.setTimeZone(timeZone);
Assert.assertEquals("2013-01-01 00:00", df.format(dateList.get(0)));
Assert.assertEquals("2013-01-15 00:00", df.format(dateList.get(1)));
Assert.assertEquals("2013-01-29 00:00", df.format(dateList.get(2)));
}
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:18,代码来源:ICal4JUtilsTest.java
示例10: parseValue
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
/**
* Parses value.
* @param str The string.
*/
private void parseValue(String str) {
if (str.equals("DATE")) {
value = Value.DATE;
}
else if (str.equals("DATE-TIME")) {
value = Value.DATE_TIME;
}
else {
throw new IllegalArgumentException("Bad value " + str);
}
}
开发者ID:1and1,项目名称:cosmo,代码行数:16,代码来源:ICalDate.java
示例11: parseDates
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
/**
* Parses dates.
* @param str The string.
* @throws ParseException - if something is wrong this exception is thrown.
*/
private void parseDates(String str)
throws ParseException {
if (str.indexOf(',')==-1) {
date = isDate() ? new Date(str) : new DateTime(str, tz);
if(isDate() && tz != null) {
throw new ParseException("DATE cannot have timezone",0);
}
}
dates = isDate() ?
new DateList(str, Value.DATE, tz) :
new DateList(str, Value.DATE_TIME, tz);
}
开发者ID:1and1,项目名称:cosmo,代码行数:20,代码来源:ICalDate.java
示例12: setDateListPropertyValue
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
protected void setDateListPropertyValue(DateListProperty prop) {
if (prop == null) {
return;
}
Value value = (Value)
prop.getParameters().getParameter(Parameter.VALUE);
if (value != null) {
prop.getParameters().remove(value);
}
value = prop.getDates().getType();
// set VALUE=DATE but not VALUE=DATE-TIME as its redundant
if(value.equals(Value.DATE)) {
prop.getParameters().add(value);
}
// update timezone for now because ical4j DateList doesn't
Parameter param = (Parameter) prop.getParameters().getParameter(
Parameter.TZID);
if (param != null) {
prop.getParameters().remove(param);
}
if(prop.getDates().getTimeZone()!=null) {
prop.getParameters().add(new TzId(prop.getDates().getTimeZone().getID()));
}
}
开发者ID:1and1,项目名称:cosmo,代码行数:29,代码来源:HibBaseEventStamp.java
示例13: fixDateTimeProperties
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
private void fixDateTimeProperties(Component component) {
PropertyList<Property> props = component.getProperties();
for(Property prop : props) {
if(prop instanceof DateProperty || prop instanceof DateListProperty) {
Value v = (Value) prop.getParameter(Parameter.VALUE);
if(Value.DATE_TIME.equals(v)) {
prop.getParameters().remove(v);
}
}
}
}
开发者ID:1and1,项目名称:cosmo,代码行数:12,代码来源:ICal3ClientFilter.java
示例14: setDateListPropertyValue
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
/**
* Sets date list property value.
* @param prop Date list property.
*/
protected void setDateListPropertyValue(DateListProperty prop) {
if (prop == null) {
return;
}
Value value = (Value)
prop.getParameters().getParameter(Parameter.VALUE);
if (value != null) {
prop.getParameters().remove(value);
}
value = prop.getDates().getType();
// set VALUE=DATE but not VALUE=DATE-TIME as its redundant
if (value.equals(Value.DATE)) {
prop.getParameters().add(value);
}
// update timezone for now because ical4j DateList doesn't
Parameter param = (Parameter) prop.getParameters().getParameter(
Parameter.TZID);
if (param != null) {
prop.getParameters().remove(param);
}
if (prop.getDates().getTimeZone() != null) {
prop.getParameters().add(new TzId(prop.getDates().getTimeZone().getID()));
}
}
开发者ID:1and1,项目名称:cosmo,代码行数:33,代码来源:MockBaseEventStamp.java
示例15: addMilestoneEvent
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
public void addMilestoneEvent(String projectShortName, java.util.Date date, LabelListValueWithMetadata m,
SearchResults cards) throws URISyntaxException {
URI uri = new URI(String.format("%s%s/milestones/", applicationUrl, projectShortName));
double closed = 0;
double total = 0;
StringBuilder descBuilder = new StringBuilder();
for (CardFullWithCounts card : cards.getFound()) {
if (card.getColumnDefinition() == ColumnDefinition.CLOSED) {
closed++;
}
total++;
descBuilder.append(getEventName(card));
descBuilder.append("\n");
}
final String name = String.format("%s - %s (%.0f%%)", projectShortName, m.getValue(),
total > 0 ? 100 * closed / total : 100);
final UUID id = new UUID(getLong(m.getCardLabelId(), m.getId()), getLong(m.getOrder(), 0));
DateTime dueDate = new DateTime(date.getTime());
dueDate.setUtc(true);
final VEvent event = new VEvent(dueDate, name);
event.getProperties().getProperty(Property.DTSTART).getParameters().add(Value.DATE_TIME);
event.getProperties().add(new Description(descBuilder.toString()));
event.getProperties().add(new Uid(id.toString()));
// Reminder on milestone's date
if (!m.getMetadata().containsKey("status") || !m.getMetadata().get("status").equals("CLOSED")) {
event.getAlarms().add(createReminder(name));
}
// Url
event.getProperties().add(new Url(uri));
events.add(event);
}
开发者ID:digitalfondue,项目名称:lavagna,代码行数:41,代码来源:CalendarVEventHandler.java
示例16: putJsonProperty
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
public void putJsonProperty(String propertyName, Object propertyValue) {
// This method is called when converting JSON to iCalendar
if ( JSON_VALUEDATATYPE.equals(propertyName) ) {
_trigger.getParameters().add(new Value((String)propertyValue));
}
else if ( JSON_RELATED.equals(propertyName) ) {
_trigger.getParameters().add(new Related((String)propertyValue));
}
else if ( JSON_VALUE.equals(propertyName) ) {
_trigger.setValue((String)propertyValue);
}
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:13,代码来源:JsonTriggerAdapter.java
示例17: putJsonProperty
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
public void putJsonProperty(String propertyName, Object propertyValue) {
// This method is called when converting JSON to iCalendar
if ( JSON_PROPERTYDATA.equals(propertyName) ) {
_data = propertyValue;
}
else if ( JSON_PROPERTYTYPE.equals(propertyName) ) {
String value = (String)propertyValue;
_valueType = new Value(value.toUpperCase());
}
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:11,代码来源:JsonXPropertyAdapter.java
示例18: createTestEvent
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
private void createTestEvent(LocalCalendar calendar) {
try {
TimeZone tzVienna = DateUtils.tzRegistry.getTimeZone("Europe/Vienna");
Event event = new Event();
event.uid = "[email protected]";
event.summary = "Sample event";
event.description = "Sample event with date/time";
event.location = "Sample location";
event.dtStart = new DtStart("20150501T120000", tzVienna);
event.dtEnd = new DtEnd("20150501T130000", tzVienna);
event.organizer = new Organizer(new URI("mailto:[email protected]"));
event.rRule = new RRule("FREQ=DAILY;COUNT=10");
event.forPublic = false;
event.status = Status.VEVENT_CONFIRMED;
// set an alarm one day, two hours, three minutes and four seconds before begin of event
event.alarms.add(new VAlarm(new Dur(-1, -2, -3, -4)));
// add two attendees
event.attendees.add(new Attendee(new URI("mailto:[email protected]")));
event.attendees.add(new Attendee(new URI("mailto:[email protected]")));
// add exception with alarm and attendee
Event exception = new Event();
exception.recurrenceId = new RecurrenceId("20150502T120000", tzVienna);
exception.summary = "Exception for sample event";
exception.dtStart = new DtStart("20150502T140000", tzVienna);
exception.dtEnd = new DtEnd("20150502T150000", tzVienna);
exception.alarms.add(new VAlarm(new Dur(-2, -3, -4, -5)));
exception.attendees.add(new Attendee(new URI("mailto:[email protected]")));
event.exceptions.add(exception);
// add EXDATE
event.exDates.add(new ExDate(new DateList("20150502T120000", Value.DATE_TIME, tzVienna)));
// add to calendar
Uri uri = new LocalEvent(calendar, event, null, null).add();
showMessage("Event created: " + uri);
showEvents(calendar);
} catch (Exception e) {
e.printStackTrace();
showMessage(e.toString());
}
}
开发者ID:6thsolution,项目名称:EasyAppleSyncAdapter,代码行数:46,代码来源:MainActivity.java
示例19: makeWelcomeItem
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
private NoteItem makeWelcomeItem(OutOfTheBoxContext context) {
NoteItem item = entityFactory.createNote();
TimeZone tz= context.getTimezone();
Locale locale = context.getLocale();
User user = context.getUser();
String name = "Welcome to Chandler Server";
String body = "1. Get a tour of Chandler @ chandlerproject.org/getstarted\n\n2. Consult our FAQ @ chandlerproject.org/faq\n\n3. Read about any known issues with the Preview release @ chandlerproject.org/knownissues\n\n4. Ask questions and give us feedback by joining the Chandler-Users mailing list @ chandlerproject.org/mailinglists. Find out how to get involved @ chandlerproject.org/getinvolved\n\n5. Learn more about the project and access a wide range of design, planning and developer documentation @ chandlerproject.org/wikihome";
String from = "OSAF";
String sentBy = "OSAF";
String to = "";
item.setUid(contentDao.generateUid());
item.setDisplayName(name);
item.setOwner(user);
item.setClientCreationDate(Calendar.getInstance(tz, locale).getTime());
item.setClientModifiedDate(item.getClientCreationDate());
TriageStatus triage = entityFactory.createTriageStatus();
TriageStatusUtil.initialize(triage);
item.setTriageStatus(triage);
item.setLastModifiedBy(user.getUsername());
item.setLastModification(ContentItem.Action.CREATED);
item.setSent(Boolean.FALSE);
item.setNeedsReply(Boolean.FALSE);
item.setIcalUid(item.getUid());
item.setBody(body);
Calendar start = Calendar.getInstance(tz, locale);
start.set(Calendar.MINUTE, 0);
start.set(Calendar.SECOND, 0);
DateTime startDate = (DateTime)
Dates.getInstance(start.getTime(), Value.DATE_TIME);
startDate.setTimeZone(vtz(tz.getID()));
EventStamp es = entityFactory.createEventStamp(item);
item.addStamp(es);
es.createCalendar();
es.setStartDate(startDate);
es.setDuration(new Dur(0, 1, 0, 0));
TaskStamp ts = entityFactory.createTaskStamp();
item.addStamp(ts);
MessageStamp ms = entityFactory.createMessageStamp();
item.addStamp(ms);
ms.setFrom(from);
ms.setTo(to);
ms.setOriginators(sentBy);
ms.setDateSent(DateUtil.formatDate(MessageStamp.FORMAT_DATE_SENT,
item.getClientCreationDate()));
return item;
}
开发者ID:1and1,项目名称:cosmo,代码行数:54,代码来源:OutOfTheBoxHelper.java
示例20: makeTryOutItem
import net.fortuna.ical4j.model.parameter.Value; //导入依赖的package包/类
private NoteItem makeTryOutItem(OutOfTheBoxContext context) {
NoteItem item = entityFactory.createNote();
TimeZone tz= context.getTimezone();
Locale locale = context.getLocale();
User user = context.getUser();
String name = "Download Chandler Desktop";
String body = "Learn more @ chandlerproject.org\n\nDownload @ chandlerproject.org/download";
TriageStatus triage = entityFactory.createTriageStatus();
TriageStatusUtil.initialize(triage);
triage.setCode(TriageStatus.CODE_LATER);
item.setUid(contentDao.generateUid());
item.setDisplayName(name);
item.setOwner(user);
item.setClientCreationDate(Calendar.getInstance(tz, locale).getTime());
item.setClientModifiedDate(item.getClientCreationDate());
item.setTriageStatus(triage);
item.setLastModifiedBy(user.getUsername());
item.setLastModification(ContentItem.Action.CREATED);
item.setSent(Boolean.FALSE);
item.setNeedsReply(Boolean.FALSE);
item.setIcalUid(item.getUid());
item.setBody(body);
Calendar start = Calendar.getInstance(tz, locale);
start.add(Calendar.DAY_OF_MONTH, 1);
start.set(Calendar.HOUR_OF_DAY, 10);
start.set(Calendar.MINUTE, 0);
start.set(Calendar.SECOND, 0);
DateTime startDate = (DateTime)
Dates.getInstance(start.getTime(), Value.DATE_TIME);
startDate.setTimeZone(vtz(tz.getID()));
EventStamp es = entityFactory.createEventStamp(item);
item.addStamp(es);
es.createCalendar();
es.setStartDate(startDate);
es.setDuration(new Dur(0, 1, 0, 0));
TaskStamp ts = entityFactory.createTaskStamp();
item.addStamp(ts);
return item;
}
开发者ID:1and1,项目名称:cosmo,代码行数:47,代码来源:OutOfTheBoxHelper.java
注:本文中的net.fortuna.ical4j.model.parameter.Value类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论