use of net.fortuna.ical4j.model.ParameterList in project bw-calendar-engine by Bedework.
the class IcalUtil method getVoter.
/**
* @param cb IcalCallback object
* @param vProp
* @return BwAttendee
* @throws Throwable
*/
public static BwAttendee getVoter(final IcalCallback cb, final Voter vProp) throws Throwable {
ParameterList pars = vProp.getParameters();
BwAttendee att = initAttendeeVoter(cb, vProp.getValue(), pars);
att.setType(BwAttendee.typeVoter);
Parameter par = pars.getParameter("STAY-INFORMED");
if (par != null) {
att.setStayInformed(((StayInformed) par).getStayInformed().booleanValue());
}
return att;
}
use of net.fortuna.ical4j.model.ParameterList in project bw-calendar-engine by Bedework.
the class IcalUtil method getTrigger.
/**
* @param pl
* @param absentOk - if true and absent returns an empty result.
* @return TriggerVal
* @throws Throwable
*/
public static TriggerVal getTrigger(final PropertyList pl, final boolean absentOk) throws Throwable {
Trigger prop = (Trigger) pl.getProperty(Property.TRIGGER);
TriggerVal tr = new TriggerVal();
if (prop == null) {
if (!absentOk) {
throw new IcalMalformedException("Invalid alarm - no trigger");
}
return tr;
}
tr.trigger = prop.getValue();
if (prop.getDateTime() != null) {
tr.triggerDateTime = true;
return tr;
}
ParameterList pars = prop.getParameters();
if (pars == null) {
tr.triggerStart = true;
return tr;
}
Parameter par = pars.getParameter("RELATED");
if (par == null) {
tr.triggerStart = true;
return tr;
}
tr.triggerStart = "START".equals(par.getValue());
return tr;
}
use of net.fortuna.ical4j.model.ParameterList in project bw-calendar-engine by Bedework.
the class IcalUtil method getAbbrevVal.
/**
* @param p
* @return AbbreviatedValue
*/
public static AbbreviatedValue getAbbrevVal(final Property p) {
ParameterList pars = p.getParameters();
ParameterList abbrevPars = pars.getParameters(Parameter.ABBREV);
Collection<String> abbrevs = new ArrayList<String>();
Iterator it = abbrevPars.iterator();
while (it.hasNext()) {
Parameter par = (Parameter) it.next();
abbrevs.add(par.getValue());
}
return new AbbreviatedValue(abbrevs, p.getValue());
}
use of net.fortuna.ical4j.model.ParameterList in project bw-calendar-engine by Bedework.
the class IcalUtil method setAttachment.
/**
* make an attachment
*
* @param val
* @return Attendee
* @throws Throwable
*/
public static Attach setAttachment(final BwAttachment val) throws Throwable {
ParameterList pars = new ParameterList();
String temp = val.getFmtType();
if (temp != null) {
pars.add(new FmtType(temp));
}
temp = val.getEncoding();
if (temp == null) {
return new Attach(pars, val.getUri());
} else {
pars.add(new Encoding(temp));
temp = val.getValueType();
if (temp != null) {
pars.add(new Value(temp));
}
return new Attach(pars, val.getValue());
}
}
use of net.fortuna.ical4j.model.ParameterList in project bw-calendar-engine by Bedework.
the class IcalUtil method addParameter.
/**
* @param prop
* @param val
*/
public static void addParameter(final Property prop, final Parameter val) {
ParameterList parl = prop.getParameters();
parl.add(val);
}
Aggregations