use of net.fortuna.ical4j.model.ParameterList in project bw-calendar-engine by Bedework.
the class IcalUtil method setVoter.
/**
* make a voter
*
* @param val BwAttendee to build from
* @return Attendee
* @throws Throwable
*/
public static Voter setVoter(final BwAttendee val) throws Throwable {
final Voter prop = new Voter(val.getAttendeeUri());
final ParameterList pars = prop.getParameters();
setAttendeeVoter(val, pars);
final String temp = val.getPartstat();
pars.add(new PartStat(temp));
return prop;
}
use of net.fortuna.ical4j.model.ParameterList in project bw-calendar-engine by Bedework.
the class IcalUtil method makeXparlist.
/**
* @param pars
* @return par list - always non-null
* @throws Throwable
*/
public static ParameterList makeXparlist(final List<BwXproperty.Xpar> pars) throws Throwable {
ParameterList xparl = new ParameterList();
if (pars == null) {
return xparl;
}
for (BwXproperty.Xpar xpar : pars) {
String xval = xpar.getValue();
if ((xval.indexOf(":") >= 0) || (xval.indexOf(";") >= 0) || (xval.indexOf(",") >= 0)) {
xval = "\"" + xval + "\"";
}
xparl.add(ParameterFactoryImpl.getInstance().createParameter(xpar.getName().toUpperCase(), xval));
}
return xparl;
}
use of net.fortuna.ical4j.model.ParameterList in project bw-calendar-engine by Bedework.
the class JsonParameters method addFields.
public static void addFields(final JsonGenerator jgen, final Property prop) throws CalFacadeException {
try {
jgen.writeStartObject();
ParameterList pl = prop.getParameters();
if ((pl != null) && (pl.size() > 0)) {
Iterator it = pl.iterator();
while (it.hasNext()) {
Parameter p = (Parameter) it.next();
String nm = p.getName().toLowerCase();
jgen.writeFieldName(nm);
if (multiMap.get(nm) == null) {
jgen.writeString(p.getValue());
} else {
outValue(jgen, p);
}
}
}
jgen.writeEndObject();
} catch (Throwable t) {
throw new CalFacadeException(t);
}
}
use of net.fortuna.ical4j.model.ParameterList in project bw-calendar-engine by Bedework.
the class BwEventUtil method getUidPar.
private static String getUidPar(final Property p) {
ParameterList pars = p.getParameters();
Parameter par = pars.getParameter(BwXproperty.xparUid);
if (par == null) {
return null;
}
return par.getValue();
}
use of net.fortuna.ical4j.model.ParameterList in project bw-calendar-engine by Bedework.
the class BwEventUtil method testXparams.
/* ====================================================================
Private methods
==================================================================== */
private static void testXparams(final Property p, final Holder<Boolean> hasXparams) {
if (hasXparams.value) {
// No need to check
return;
}
ParameterList params = p.getParameters();
Iterator parit = params.iterator();
while (parit.hasNext()) {
Parameter param = (Parameter) parit.next();
if (!(param instanceof XParameter)) {
continue;
}
XParameter xpar = (XParameter) param;
if (xpar.getName().toUpperCase().equals(BwXproperty.xparUid)) {
continue;
}
hasXparams.value = true;
}
}
Aggregations