本文整理汇总了Java中net.fortuna.ical4j.model.Property类的典型用法代码示例。如果您正苦于以下问题:Java Property类的具体用法?Java Property怎么用?Java Property使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Property类属于net.fortuna.ical4j.model包,在下文中一共展示了Property类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadPartyAssignment
import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
protected static void loadPartyAssignment(Property property, GenericValue partyAssign, Map<String, Object> context) {
getPartyUrl(property, partyAssign, context);
if (UtilValidate.isEmpty(property.getValue())) {
try {
// RFC 2445 4.8.4.1 and 4.8.4.3 Value must be a URL
property.setValue("MAILTO:[email protected]");
} catch (Exception e) {
Debug.logError(e, "Error while setting Property value: ", module);
}
}
ParameterList parameterList = property.getParameters();
if (partyAssign != null) {
replaceParameter(parameterList, toXParameter(partyIdXParamName, partyAssign.getString("partyId")));
replaceParameter(parameterList, new Cn(makePartyName(partyAssign)));
replaceParameter(parameterList, toParticipationStatus(partyAssign.getString("assignmentStatusId")));
}
}
示例2: loadWorkEffort
import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
protected static void loadWorkEffort(PropertyList componentProps, GenericValue workEffort) {
replaceProperty(componentProps, new DtStamp()); // iCalendar object created date/time
replaceProperty(componentProps, toClazz(workEffort.getString("scopeEnumId")));
replaceProperty(componentProps, toCreated(workEffort.getTimestamp("createdDate")));
replaceProperty(componentProps, toDescription(workEffort.getString("description")));
replaceProperty(componentProps, toDtStart(workEffort.getTimestamp("estimatedStartDate")));
replaceProperty(componentProps, toLastModified(workEffort.getTimestamp("lastModifiedDate")));
replaceProperty(componentProps, toPriority(workEffort.getLong("priority")));
replaceProperty(componentProps, toLocation(workEffort.getString("locationDesc")));
replaceProperty(componentProps, toStatus(workEffort.getString("currentStatusId")));
replaceProperty(componentProps, toSummary(workEffort.getString("workEffortName")));
Property uid = componentProps.getProperty(Uid.UID);
if (uid == null) {
// Don't overwrite UIDs created by calendar clients
replaceProperty(componentProps, toUid(workEffort.getString("workEffortId")));
}
replaceProperty(componentProps, toXProperty(workEffortIdXPropName, workEffort.getString("workEffortId")));
}
示例3: ReadCalendarFiles
import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
public ReadCalendarFiles(String filePath) throws IOException, ParserException {
Map<String, String> calendarEntry = null;
FileInputStream fin = new FileInputStream(filePath);
CalendarBuilder builder = new CalendarBuilder();
net.fortuna.ical4j.model.Calendar calendar = builder.build(fin);
for (Iterator i = calendar.getComponents().iterator(); i.hasNext(); ) {
Component component = (Component) i.next();
if (component.getName().equalsIgnoreCase("VEVENT")) {
calendarEntry = new HashMap<>();
for (Iterator j = component.getProperties().iterator(); j.hasNext(); ) {
net.fortuna.ical4j.model.Property property = (Property) j.next();
calendarEntry.put(property.getName(), property.getValue());
}
calendarEntries.add(calendarEntry);
}
}
}
示例4: getEventsInPeriod
import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
public static List<Event> getEventsInPeriod(final Calendar cal, final Period period) {
final Filter filter = new Filter(new Rule[] {new PeriodRule(period)}, Filter.MATCH_ALL);
final List<Component> filtered = (List<Component>) filter.filter(cal.getComponents());
final List<Event> ret = new ArrayList<>();
for (final Component comp : filtered) {
if (!(comp instanceof VEvent)) {
continue;
}
final PeriodList recurrenceSet = comp.calculateRecurrenceSet(period);
for (final Object p : recurrenceSet) {
ret.add(new Event(
getValueIfExists(comp, Property.SUMMARY),
getValueIfExists(comp, Property.URL),
(Period) p));
}
}
Collections.sort(ret);
return ret;
}
示例5: cancelEvent
import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public VEvent cancelEvent(VEvent vevent) {
if(!isIcsEnabled()) {
log.debug("ExternalCalendaringService is disabled. Enable via calendar.ics.generation.enabled=true in sakai.properties");
return null;
}
// You can only have one status so make sure we remove any previous ones.
vevent.getProperties().removeAll(vevent.getProperties(Property.STATUS));
vevent.getProperties().add(Status.VEVENT_CANCELLED);
// Must define a sequence for cancellations. If one was not defined when the event was created use 1
if (vevent.getProperties().getProperty(Property.SEQUENCE) == null) {
vevent.getProperties().add(new Sequence("1"));
}
if(log.isDebugEnabled()){
log.debug("VEvent cancelled:" + vevent);
}
return vevent;
}
示例6: evaluate
import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
/**
* Evaluates.
* @param property The property.
* @param filter The text match filter.
* @return The result.
*/
private boolean evaluate(Property property, TextMatchFilter filter) {
boolean matched = false;
if(filter.isCaseless()) {
matched = property.getValue().toLowerCase(ENGLISH).contains(filter.getValue().toLowerCase(ENGLISH));
}
else {
matched = property.getValue().contains(filter.getValue());
}
if(filter.isNegateCondition()) {
return !matched;
}
else {
return matched;
}
}
示例7: filterProperties
import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
private void filterProperties(PropertyList properties,
StringBuffer buffer) {
if (isAllProperties()) {
buffer.append(properties.toString());
return;
}
if (! hasPropertyFilters()) {
return;
}
for (Property property : (List<Property>) properties) {
PropertyMatch pm = testPropertyValue(property.getName());
if (pm.isMatch()) {
if (pm.isValueExcluded()) {
chompPropertyValue(property, buffer);
}
else {
buffer.append(property.toString());
}
}
}
}
示例8: verifyExpandedCalendar
import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
/**
* Verify expand calendar.
* @param calendar The calendar.
*/
private void verifyExpandedCalendar(Calendar calendar) {
// timezone should be stripped
Assert.assertNull(calendar.getComponents().getComponent("VTIMEZONE"));
ComponentList comps = calendar.getComponents().getComponents("VEVENT");
for(@SuppressWarnings("unchecked")
Iterator<VEvent> it = comps.iterator();it.hasNext();) {
VEvent event = it.next();
DateTime dt = (DateTime) event.getStartDate().getDate();
// verify start dates are UTC
Assert.assertNull(event.getStartDate().getParameters().getParameter(Parameter.TZID));
Assert.assertTrue(dt.isUtc());
// verify no recurrence rules
Assert.assertNull(event.getProperties().getProperty(Property.RRULE));
}
}
示例9: ICalDate
import net.fortuna.ical4j.model.Property; //导入依赖的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;
}
示例10: getDuration
import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
/**
* Get the duration for an event. If the DURATION property
* exist, use that. Else, calculate duration from DTSTART and
* DTEND.
* @param event The event.
* @return duration for event
*/
public static Dur getDuration(VEvent event) {
Duration duration = (Duration)
event.getProperties().getProperty(Property.DURATION);
if (duration != null) {
return duration.getDuration();
}
DtStart dtstart = event.getStartDate();
if (dtstart == null) {
return null;
}
DtEnd dtend = (DtEnd) event.getProperties().getProperty(Property.DTEND);
if (dtend == null) {
return null;
}
return new Duration(dtstart.getDate(), dtend.getDate()).getDuration();
}
示例11: evaluate
import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
/**
* Evaluates.
* @param property The property.
* @param filter The text match filter.
* @return The result.
*/
private boolean evaluate(Property property, TextMatchFilter filter) {
boolean matched = false;
if(filter.isCaseless()) {
matched = property.getValue().toLowerCase(CosmoConstants.LANGUAGE_LOCALE).contains(filter.getValue().toLowerCase(CosmoConstants.LANGUAGE_LOCALE));
}
else {
matched = property.getValue().contains(filter.getValue());
}
if(filter.isNegateCondition()) {
return !matched;
}
else {
return matched;
}
}
示例12: filterProperties
import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
private void filterProperties(PropertyList<Property> properties,
StringBuffer buffer) {
if (isAllProperties()) {
buffer.append(properties.toString());
return;
}
if (! hasPropertyFilters()) {
return;
}
for (Property property : properties) {
PropertyMatch pm = testPropertyValue(property.getName());
if (pm.isMatch()) {
if (pm.isValueExcluded()) {
chompPropertyValue(property, buffer);
}
else {
buffer.append(property.toString());
}
}
}
}
示例13: setExceptionDates
import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
/**
* Sets exception dates.
* @param dates The date list.
*/
public void setExceptionDates(DateList dates) {
if (dates == null) {
return;
}
PropertyList<Property> properties = getEvent().getProperties();
for (Property exdate : properties.getProperties(Property.EXDATE)) {
properties.remove(exdate);
}
if (dates.isEmpty()) {
return;
}
ExDate exDate = new ExDate(dates);
setDateListPropertyValue(exDate);
properties.add(exDate);
}
示例14: setRecurrenceDates
import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
public void setRecurrenceDates(DateList dates) {
if (dates == null) {
return;
}
PropertyList<RDate> rdateList = getEvent().getProperties().getProperties(Property.RDATE);
for (RDate rdate : rdateList) {
rdateList.remove(rdate);
}
if (dates.isEmpty()) {
return;
}
RDate rDate = new RDate(dates);
setDateListPropertyValue(rDate);
rdateList.add(rDate);
}
示例15: setDisplayAlarmTrigger
import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
public void setDisplayAlarmTrigger(Trigger newTrigger) {
VAlarm alarm = getDisplayAlarm();
if(alarm==null) {
return;
}
Trigger oldTrigger = (Trigger) alarm.getProperties().getProperty(
Property.TRIGGER);
if (oldTrigger != null) {
alarm.getProperties().remove(oldTrigger);
}
if(newTrigger!=null) {
alarm.getProperties().add(newTrigger);
}
}