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

Java Parameter类代码示例

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

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



Parameter类属于net.fortuna.ical4j.model包,在下文中一共展示了Parameter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: evaluate

import net.fortuna.ical4j.model.Parameter; //导入依赖的package包/类
/**
 * Evaluates.
 * @param param The parameter.
 * @param filter The text match filter.
 * @return The result.
 */
private boolean evaluate(Parameter param, TextMatchFilter filter) {
    boolean matched = false;
    if(filter.isCaseless()) {
        matched = param.getValue().toLowerCase(ENGLISH).contains(filter.getValue().toLowerCase(ENGLISH));
    }
    else {
        matched = param.getValue().contains(filter.getValue());
    }
    
    if(filter.isNegateCondition()) {
        return !matched;
    }
    else {
        return matched;
    }
}
 
开发者ID:ksokol,项目名称:carldav,代码行数:23,代码来源:CalendarFilterEvaluater.java


示例2: verifyExpandedCalendar

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


示例3: evaluate

import net.fortuna.ical4j.model.Parameter; //导入依赖的package包/类
/**
 * Evaluates.
 * @param param The parameter.
 * @param filter The text match filter.
 * @return The result.
 */
private boolean evaluate(Parameter param, TextMatchFilter filter) {
    boolean matched = false;
    if(filter.isCaseless()) {
        matched = param.getValue().toLowerCase(CosmoConstants.LANGUAGE_LOCALE).contains(filter.getValue().toLowerCase(CosmoConstants.LANGUAGE_LOCALE));
    }
    else {
        matched = param.getValue().contains(filter.getValue());
    }
    
    if(filter.isNegateCondition()) {
        return !matched;
    }
    else {
        return matched;
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:23,代码来源:CalendarFilterEvaluater.java


示例4: setDatePropertyValue

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


示例5: setAnyTime

import net.fortuna.ical4j.model.Parameter; //导入依赖的package包/类
public void setAnyTime(Boolean isAnyTime) {
    DtStart dtStart = getEvent().getStartDate();
    if (dtStart == null) {
        throw new IllegalStateException("event has no start date");
    }
    Parameter parameter = dtStart.getParameters().getParameter(
            PARAM_X_OSAF_ANYTIME);

    // add X-OSAF-ANYTIME if it doesn't exist
    if (parameter == null && Boolean.TRUE.equals(isAnyTime)) {
        dtStart.getParameters().add(getAnyTimeXParam());
        return;
    }

    // if it exists, update based on isAnyTime
    if (parameter != null) {
        dtStart.getParameters().remove(parameter);
        if (Boolean.TRUE.equals(isAnyTime)) {
            dtStart.getParameters().add(getAnyTimeXParam());
        }
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:23,代码来源:HibBaseEventStamp.java


示例6: setAnyTime

import net.fortuna.ical4j.model.Parameter; //导入依赖的package包/类
/**
 * Toggle the event exception anytime parameter.
 * @param isAnyTime True if the event occurs anytime<br/>
 *                  False if the event does not occur anytime</br>
 *                  null if the event should inherit the anyTime
 *                  attribute of the master event.
 */
@Override
public void setAnyTime(Boolean isAnyTime) {
    // Interpret null as "missing" anyTime, meaning inherited from master
    if(isAnyTime==null) {
        DtStart dtStart = getEvent().getStartDate();
        if (dtStart == null) {
            throw new IllegalStateException("event has no start date");
        }
        Parameter parameter = dtStart.getParameters().getParameter(
                PARAM_X_OSAF_ANYTIME);
        if(parameter!=null) {
            dtStart.getParameters().remove(parameter);
        }
        
        // "missing" anyTime is represented as X-OSAF-ANYTIME=MISSING
        dtStart.getParameters().add(getInheritedAnyTimeXParam());
    } else {
        super.setAnyTime(isAnyTime);
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:28,代码来源:HibEventExceptionStamp.java


示例7: isAnyTime

import net.fortuna.ical4j.model.Parameter; //导入依赖的package包/类
/**
 * Is the event exception marked as anytime.
 * @return True if the event is an anytime event<br/>
 *         False if it is not an anytime event<br/>
 *         null if the anyTime attribute is "missing", ie inherited
 *         from the master event.
 */
@Override
public Boolean isAnyTime() {
    DtStart dtStart = getEvent().getStartDate();
    if (dtStart == null) {
        return Boolean.FALSE;
    }
    Parameter parameter = dtStart.getParameters()
        .getParameter(PARAM_X_OSAF_ANYTIME);
    if (parameter == null) {
        return Boolean.FALSE;
    }
 
    // return null for "missing" anyTime
    if(!VALUE_MISSING.equals(parameter.getValue())) {
        return Boolean.valueOf(VALUE_TRUE.equals(parameter.getValue()));
    }
    
    return Boolean.FALSE;
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:27,代码来源:HibEventExceptionStamp.java


示例8: areTimeZoneIdsValid

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


示例9: verifyPeriods

import net.fortuna.ical4j.model.Parameter; //导入依赖的package包/类
/**
 * verify periods.
 * @param vfb VFreeBusy.
 * @param fbtype FbType.
 * @param periods The periods.
 */
private void verifyPeriods(VFreeBusy vfb, FbType fbtype, String periods) {
    PropertyList<FreeBusy> props = vfb.getProperties(Property.FREEBUSY);
    FreeBusy fb = null;
    
    for(FreeBusy next : props) {            
        FbType type = (FbType) next.getParameter(Parameter.FBTYPE);
        if(type==null && fbtype==null) {
            fb = next;
        }
        else if(type != null && type.equals(fbtype)) {
            fb = next;
        }
    }
    
    if (fb == null) {
        Assert.fail("periods " + periods + " not in " + vfb.toString());
    }
    Assert.assertEquals(periods, fb.getPeriods().toString());
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:26,代码来源:StandardCalendarQueryProcessorTest.java


示例10: verifyExpandedCalendar

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


示例11: setAnyTime

import net.fortuna.ical4j.model.Parameter; //导入依赖的package包/类
/**
 * Sets any time.
 * @param isAnyTime Boolean.
 */
@Override
public void setAnyTime(Boolean isAnyTime) {
    // Interpret null as "missing" anyTime, meaning inherited from master
    if(isAnyTime==null) {
        DtStart dtStart = getEvent().getStartDate();
        if (dtStart == null) {
            throw new IllegalStateException("event has no start date");
        }
        Parameter parameter = dtStart.getParameters().getParameter(
                PARAM_X_OSAF_ANYTIME);
        if (parameter != null) {
            dtStart.getParameters().remove(parameter);
        }
        
        // "missing" anyTime is represented as X-OSAF-ANYTIME=MISSING
        dtStart.getParameters().add(getInheritedAnyTimeXParam());
    } else {
        super.setAnyTime(isAnyTime);
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:25,代码来源:MockEventExceptionStamp.java


示例12: isAnyTime

import net.fortuna.ical4j.model.Parameter; //导入依赖的package包/类
/**
 * Is any time.
 * @return boolean.
 */
@Override
public Boolean isAnyTime() {
    DtStart dtStart = getEvent().getStartDate();
    if (dtStart == null) {
        return Boolean.FALSE;
    }
    Parameter parameter = dtStart.getParameters()
        .getParameter(PARAM_X_OSAF_ANYTIME);
    if (parameter == null) {
        return Boolean.FALSE;
    }
 
    // return null for "missing" anyTime
    if (VALUE_MISSING.equals(parameter.getValue())) {
        return null;
    }

    return Boolean.valueOf(VALUE_TRUE.equals(parameter.getValue()));
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:24,代码来源:MockEventExceptionStamp.java


示例13: setDatePropertyValue

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


示例14: setAnyTime

import net.fortuna.ical4j.model.Parameter; //导入依赖的package包/类
/**
 * Sets any time.
 * @param isAnyTime isAnyTime.
 */
public void setAnyTime(Boolean isAnyTime) {
    DtStart dtStart = getEvent().getStartDate();
    if (dtStart == null) {
        throw new IllegalStateException("event has no start date");
    }
    Parameter parameter = dtStart.getParameters().getParameter(
            PARAM_X_OSAF_ANYTIME);

    // add X-OSAF-ANYTIME if it doesn't exist
    if (parameter == null && Boolean.TRUE.equals(isAnyTime)) {
        dtStart.getParameters().add(getAnyTimeXParam());
        return;
    }

    // if it exists, update based on isAnyTime
    if (parameter != null) {
        dtStart.getParameters().remove(parameter);
        if (Boolean.TRUE.equals(isAnyTime)) {   
            dtStart.getParameters().add(getAnyTimeXParam());
        }
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:27,代码来源:MockBaseEventStamp.java


示例15: findOrCreateUser

import net.fortuna.ical4j.model.Parameter; //导入依赖的package包/类
protected ICalendarUser findOrCreateUser(Property source) {
	URI addr = null;
	if (source instanceof Organizer) {
		addr = ((Organizer) source).getCalAddress();
	}
	if (source instanceof Attendee) {
		addr = ((Attendee) source).getCalAddress();
	}
	if (addr == null) {
		return null;
	}

	String email = mailto(addr.toString(), true);
	ICalendarUserRepository repo = Beans.get(ICalendarUserRepository.class);
	ICalendarUser user = repo.findByEmail(email);
	if (user == null) {
		user = new ICalendarUser();
		user.setEmail(email);
	}
	if (source.getParameter(Parameter.CN) != null) {
		user.setName(source.getParameter(Parameter.CN).getValue());
	}

	return user;
}
 
开发者ID:axelor,项目名称:axelor-business-suite,代码行数:26,代码来源:ICalendarService.java


示例16: fromXParameter

import net.fortuna.ical4j.model.Parameter; //导入依赖的package包/类
protected static String fromXParameter(ParameterList parameterList, String parameterName) {
    if (parameterName == null) {
        return null;
    }
    Parameter parameter = parameterList.getParameter(parameterName);
    if (parameter != null) {
        return parameter.getValue();
    }
    return null;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:11,代码来源:ICalConverter.java


示例17: loadRelatedParties

import net.fortuna.ical4j.model.Parameter; //导入依赖的package包/类
protected static void loadRelatedParties(List<GenericValue> relatedParties, PropertyList componentProps, Map<String, Object> context) {
    PropertyList attendees = componentProps.getProperties("ATTENDEE");
    for (GenericValue partyValue : relatedParties) {
        if ("CAL_ORGANIZER~CAL_OWNER".contains(partyValue.getString("roleTypeId"))) {
            // RFC 2445 4.6.1, 4.6.2, and 4.6.3 ORGANIZER can appear only once
            replaceProperty(componentProps, createOrganizer(partyValue, context));
        } else {
            String partyId = partyValue.getString("partyId");
            boolean newAttendee = true;
            Attendee attendee = null;
            Iterator<Attendee> i = UtilGenerics.cast(attendees.iterator());
            while (i.hasNext()) {
                attendee = i.next();
                Parameter xParameter = attendee.getParameter(partyIdXParamName);
                if (xParameter != null && partyId.equals(xParameter.getValue())) {
                    loadPartyAssignment(attendee, partyValue, context);
                    newAttendee = false;
                    break;
                }
            }
            if (newAttendee) {
                attendee = createAttendee(partyValue, context);
                componentProps.add(attendee);
            }
        }
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:28,代码来源:ICalConverter.java


示例18: replaceParameter

import net.fortuna.ical4j.model.Parameter; //导入依赖的package包/类
protected static void replaceParameter(ParameterList parameterList, Parameter parameter) {
    if (parameter == null) {
        return;
    }
    Parameter existingParam = parameterList.getParameter(parameter.getName());
    if (existingParam != null) {
        parameterList.remove(existingParam);
    }
    parameterList.add(parameter);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:11,代码来源:ICalConverter.java


示例19: parseDate

import net.fortuna.ical4j.model.Parameter; //导入依赖的package包/类
/**
 * Convenience function to parse date from {@link net.fortuna.ical4j.model.Property} to
 * {@link Date}
 *
 * @param dt       DATE-TIME Property from which we parse.
 * @param timeZone Timezone of the Date.
 * @return {@link java.util.Date} representation of the iCalendar value.
 */
public Date parseDate(Property dt, TimeZone timeZone) {
	if (dt == null || Strings.isEmpty(dt.getValue())) {
		return null;
	}

	String[] acceptedFormats = {"yyyyMMdd'T'HHmmss", "yyyyMMdd'T'HHmmss'Z'", "yyyyMMdd"};
	Parameter tzid = dt.getParameter(Parameter.TZID);
	if (tzid == null) {
		return parseDate(dt.getValue(), acceptedFormats, timeZone);
	} else {
		return parseDate(dt.getValue(), acceptedFormats, getTimeZone(tzid.getValue()));
	}
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:22,代码来源:IcalUtils.java


示例20: getRange

import net.fortuna.ical4j.model.Parameter; //导入依赖的package包/类
/**
 * Gets range.
 *
 * @param comp The component.
 * @return The result.
 */
private final boolean getRange(Component comp) {
    RecurrenceId rid = (RecurrenceId) comp.getProperties().getProperty(
            Property.RECURRENCE_ID);
    if (rid == null) {
        return false;
    }
    Parameter range = rid.getParameters().getParameter(Parameter.RANGE);
    return range != null && "THISANDFUTURE".equals(range.getValue());
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:16,代码来源:InstanceList.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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