• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Property类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.fortuna.ical4j.model.Property的典型用法代码示例。如果您正苦于以下问题:Java Property类的具体用法?Java Property怎么用?Java Property使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Property类属于net.fortuna.ical4j.model包,在下文中一共展示了Property类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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")));
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:18,代码来源:ICalConverter.java


示例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")));
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:19,代码来源:ICalConverter.java


示例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);
    }
  }
}
 
开发者ID:mark-watson,项目名称:power-java,代码行数:18,代码来源:ReadCalendarFiles.java


示例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;
}
 
开发者ID:Meet-Hub-Hannover,项目名称:mailer,代码行数:20,代码来源:Event.java


示例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;
	
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:26,代码来源:ExternalCalendaringServiceImpl.java


示例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;
    }
}
 
开发者ID:ksokol,项目名称:carldav,代码行数:23,代码来源:CalendarFilterEvaluater.java


示例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());
            }
        }
    }
}
 
开发者ID:ksokol,项目名称:carldav,代码行数:24,代码来源:OutputFilter.java


示例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));
    }
}
 
开发者ID:ksokol,项目名称:carldav,代码行数:24,代码来源:ExpandRecurringEventsTest.java


示例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;
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:28,代码来源:ICalDate.java


示例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();
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:24,代码来源:ICalendarUtils.java


示例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;
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:23,代码来源:CalendarFilterEvaluater.java


示例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());
            }
        }
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:24,代码来源:OutputFilter.java


示例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);
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:22,代码来源:MockBaseEventStamp.java


示例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);   
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:18,代码来源:HibBaseEventStamp.java


示例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);
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:17,代码来源:HibBaseEventStamp.java


示例16: setDisplayAlarmTriggerDate

import net.fortuna.ical4j.model.Property; //导入依赖的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


示例17: isValid

import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
@Override
protected boolean isValid(VEvent event, ValidationConfig config) {
                    
    List<? extends Property> rrules = event.getProperties(prop);
    if(rrules == null){
        return true;
    }
    for(Property p : rrules){
        RRule rrule = (RRule)p; 
        if(! isRRuleValid(rrule, config)){
            return false;
        }
    }
    
    return true;
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:17,代码来源:EventValidator.java


示例18: areTimeZoneIdsValid

import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
private static boolean areTimeZoneIdsValid(VEvent event){
    for(String propertyName : PROPERTIES_WITH_TIMEZONES){
        List<Property> props = event.getProperties(propertyName);
        for(Property p : props){
            if(p != null && p.getParameter(Parameter.TZID) != null){
                String tzId = p.getParameter(Parameter.TZID).getValue();
                if(tzId != null && timeZoneRegistry.getTimeZone(tzId) == null){
                    LOG.warn("Unknown TZID [" + tzId + "] for event " + event);
                    return false;
                    
                }
            }
        }
    }
    return true;
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:17,代码来源:EventValidator.java


示例19: setCalendar

import net.fortuna.ical4j.model.Property; //导入依赖的package包/类
/**
 * <p>
 * Imports a calendar object containing a VAVAILABILITY. 
 * @param cal The calendar imported.
 * @throws CosmoDavException - if something is wrong this exception is thrown.
 * </p>
 */
public void setCalendar(Calendar cal) throws CosmoDavException {
    AvailabilityItem availability = (AvailabilityItem) getItem();
    
    availability.setAvailabilityCalendar(cal);
    
    Component comp = cal.getComponent(ICalendarConstants.COMPONENT_VAVAILABLITY);
    if (comp==null) {
        throw new UnprocessableEntityException("VCALENDAR does not contain a VAVAILABILITY");
    }

    String val = null;
    Property prop = comp.getProperty(Property.UID);
    if (prop != null) {
        val = prop.getValue();
    }
    if (StringUtils.isBlank(val)) {
        throw new UnprocessableEntityException("VAVAILABILITY does not contain a UID");
    }
    availability.setIcalUid(val);
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:28,代码来源:DavAvailability.java


示例20: 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<VEvent> comps = calendar.getComponents().getComponents("VEVENT");
    
    for(VEvent event : comps) {
        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));
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:22,代码来源:ExpandRecurringEventsTest.java



注:本文中的net.fortuna.ical4j.model.Property类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FilePredicates类代码示例发布时间:2022-05-21
下一篇:
Java HelloService类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap