本文整理汇总了Java中net.fortuna.ical4j.model.ParameterList类的典型用法代码示例。如果您正苦于以下问题:Java ParameterList类的具体用法?Java ParameterList怎么用?Java ParameterList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParameterList类属于net.fortuna.ical4j.model包,在下文中一共展示了ParameterList类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadPartyAssignment
import net.fortuna.ical4j.model.ParameterList; //导入依赖的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: fromXParameter
import net.fortuna.ical4j.model.ParameterList; //导入依赖的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;
}
示例3: replaceParameter
import net.fortuna.ical4j.model.ParameterList; //导入依赖的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);
}
示例4: evaluate
import net.fortuna.ical4j.model.ParameterList; //导入依赖的package包/类
/**
* Evaluates.
* @param params The parameter list.
* @param filter Tge text match filter.
* @return The result.
*/
private boolean evaluate(ParameterList params, TextMatchFilter filter) {
// Evaluate textmatch filter against a set of parameters.
// If any param matches, then evaluation succeeds.
// This is basically a big OR
for(Iterator<Parameter> it = params.iterator(); it.hasNext();) {
Parameter param = it.next();
if(evaluate(param,filter)==true) {
return true;
}
}
return false;
}
示例5: convertAttendees
import net.fortuna.ical4j.model.ParameterList; //导入依赖的package包/类
/**
* This method returns a never null but possibly empty {@link HashSet} of {@link Attendee}s.
* This method will attempt to generate a {@link Attendee} for each {@link AttendeeType} contained within @link {@link NonEmptyArrayOfAttendeesType}.
* An a {@link Attendee} will not be generated for any {@link AttendeeType} with a missing or invalid {@link EmailAddressType}
*
* Attendee Responses are only present if you obtained CalendarItem from Exchange as organizer. @see <a href="http://office.microsoft.com/en-us/outlook-help/organize-meetings-with-outlook-RZ001166003.aspx?section=20">Attendees do not see responses</a>
*
* {@link com.microsoft.exchange.impl.ExchangeEventConverterImpl.convertEmailAddressType(EmailAddressType)} for details on how recipient EmailAddressType properties are mapped to {@link Parameter}s.
*
* @param attendees
* @param myResponseType - a {@link PartStat} parameter will be added to every {@link Attendee} if and only if myResponseType.eqals( {@link ResponseTypeType}.ORGANIZER and the corresponding {@link AttendeeType} contains a valid {@link ResponseTypeType} )
* @param requiredAttendees - Indicates which {@link Role} parameter to add to attendees. True indicates that the {@link NonEmptyArrayOfAttendeesType} represent Role.REQ_PARTICIPANT, false indicates the {@link NonEmptyArrayOfAttendeesType} are optional attendees
* @return
*/
protected Set<Attendee> convertAttendees(NonEmptyArrayOfAttendeesType attendees,ResponseTypeType myResponseType, Role role){
Set<Attendee> attendeeSet = new HashSet<Attendee>();
if(null != attendees && !CollectionUtils.isEmpty(attendees.getAttendees())){
for(AttendeeType attendeeType : attendees.getAttendees()){
if(null != attendeeType){
EmailAddressType mailbox = attendeeType.getMailbox();
Pair<ParameterList, URI> attendeePair = convertEmailAddressType(mailbox, role);
URI attendeeURI = attendeePair.getRight();
ParameterList attendeeParams = attendeePair.getLeft();
if(null != attendeeURI){
Attendee attendee = new Attendee(attendeeParams, attendeeURI);
if(null != myResponseType && myResponseType.equals(ResponseTypeType.ORGANIZER)){
//responseType should be present
ResponseTypeType responseType = attendeeType.getResponseType();
if(null != responseType){
//go ahead and add a partstat
attendee.getParameters().add(convertResponseTypeTypeToPartStat(responseType));
}
}
if(attendeeSet.add(attendee)){
log.debug("added Attendee="+attendee);
}
}
}
}
}else{
log.debug("no attendees");
}
return attendeeSet;
}
示例6: startProperty
import net.fortuna.ical4j.model.ParameterList; //导入依赖的package包/类
public void startProperty(String property) {
// Start a new parameter list
_parameters = new ParameterList();
}
示例7: convertExtendedPropertyType
import net.fortuna.ical4j.model.ParameterList; //导入依赖的package包/类
/**
* return a never null but possibly empty {@link Collection} of {@link XProperty}
*
* if an {@link ExtendedPropertyType} contains multiple values this method will return multiple {@link XProperty}'s.
*
* @param extendedProperty
* @return
*/
private Collection<XProperty> convertExtendedPropertyType(ExtendedPropertyType extendedProperty){
Collection<XProperty> xprops = new LinkedHashSet<XProperty>();
PathToExtendedFieldType extendedFieldURI = extendedProperty.getExtendedFieldURI();
if(null != extendedFieldURI){
String propertyName = extendedFieldURI.getPropertyName();
if(StringUtils.isBlank(propertyName)){
DistinguishedPropertySetType distinguishedPropertySetId = extendedFieldURI.getDistinguishedPropertySetId();
if(null != distinguishedPropertySetId){
propertyName = distinguishedPropertySetId.value();
}
}
ParameterList params = new ParameterList();
String exPropSetId = extendedFieldURI.getPropertySetId();
if(StringUtils.isNotBlank(exPropSetId)){
params.add(new PathToExtendedFieldTypePropertySetId(extendedFieldURI));
}
Integer exPropId = extendedFieldURI.getPropertyId();
if(StringUtils.isNotBlank(exPropId.toString())){
params.add(new PathToExtendedFieldTypePropertyId(extendedFieldURI));
}
MapiPropertyTypeType propertyType = extendedFieldURI.getPropertyType();
if(null != propertyType && StringUtils.isNotBlank(propertyType.value())){
params.add(new PathToExtendedFieldTypePropertyType(extendedFieldURI));
}
String propertyTag = extendedFieldURI.getPropertyTag();
if(StringUtils.isNotBlank(propertyTag)){
params.add(new PathToExtendedFieldTypePropertyTag(extendedFieldURI));
}
Set<String> xPropertyValues = new HashSet<String>();
if(StringUtils.isNotBlank(propertyName)){
NonEmptyArrayOfPropertyValuesType values = extendedProperty.getValues();
if(null != values && !CollectionUtils.isEmpty(values.getValues())){
xPropertyValues.addAll(values.getValues());
}else if(null != extendedProperty.getValue()){
xPropertyValues.add(extendedProperty.getValue());
}
}else{
log.error("Unable to generate XProperty(s). propertyName not found for ExtendedPropertyType="+extendedProperty);
}
if(!CollectionUtils.isEmpty(xPropertyValues)){
Integer count = 0;
for(String xValue: xPropertyValues){
xprops.add(new XProperty(propertyName, params, xValue));
propertyName+="_"+count;
count++;
}
}else{
log.error("Unable to generate XProperty(s). propertyValue(s) not found for ExtendedPropertyType="+extendedProperty);
}
}
return xprops;
}
示例8: convertEmailAddressType
import net.fortuna.ical4j.model.ParameterList; //导入依赖的package包/类
/**
* This method will return a never null a {@link Pair}<{@link ParameterList},{@link URI}> for a given {@link EmailAddressType}
* This method will return a null URI element if the {@link EmailAddressType} does not contain a valid EmailAddress property
* This method will return a never null but possibly empty {@link ParameterList}.
*
* ParamaterList may contain the following {@link Parameter}s:
* {@link Cn}, {@link EmailAddressRoutingType}, {@link EmailAddressMailboxType}
*
* @param recipient
* @return
*/
protected Pair<ParameterList, URI> convertEmailAddressType(EmailAddressType emailAddressType, Role role){
URI uri = null;
ParameterList params = new ParameterList();
if(null != emailAddressType){
String emailAddress = emailAddressType.getEmailAddress();
if(StringUtils.isNotBlank(emailAddress)){
uri = emailToURI(emailAddress);
}else{
log.warn("convertEmailAddressType: could not generate URI.");
}
if(null != role){
params.add(role);
}
String name = emailAddressType.getName();
if(StringUtils.isNotBlank(name)){
params.add(new Cn(name));
}else{
log.debug("convertEmailAddressType: could not generate Cn");
}
String routingType = emailAddressType.getRoutingType();
if(StringUtils.isNotBlank(routingType)){
params.add(new EmailAddressRoutingType(routingType));
}else{
log.debug("convertEmailAddressType: could not generate EmailAddressRoutingType");
}
MailboxTypeType mailboxType = emailAddressType.getMailboxType();
if(null != mailboxType){
params.add(new EmailAddressMailboxType(mailboxType));
CuType cuType = convertMailboxTypeTypeToCuType(mailboxType,role);
params.add(cuType);
}else{
log.debug("convertEmailAddressType: could not generate EmailAddressMailboxType");
}
}else{
log.debug("convertEmailAddressType: EmailAddressType = null");
}
Pair<ParameterList,URI> pair = Pair.of(params, uri);
return pair;
}