protected static BasePropertyType tzidProp(final BasePropertyType prop, final String val) { if (val == null) { return prop; } final ArrayOfParameters pars = getAop(prop); final TzidParamType tzid = new TzidParamType(); tzid.setText(val); final JAXBElement<TzidParamType> t = of.createTzid(tzid); pars.getBaseParameter().add(t); return prop; }
/** Convert a parameter * @param prop - parameters go here * @param xp - a parameter * @throws Throwable */ protected static void xparam(final BasePropertyType prop, final Xpar xp) throws Throwable { ArrayOfParameters aop = prop.getParameters(); if (aop == null) { aop = new ArrayOfParameters(); prop.setParameters(aop); } if (xp.getName().equalsIgnoreCase("tzid")) { final TzidParamType tz = new TzidParamType(); tz.setText(xp.getValue()); aop.getBaseParameter().add(of.createTzid(tz)); return; } if (xp.getName().equalsIgnoreCase("altrep")) { altrepProp(prop, xp.getValue()); return; } }
/** Initialize the DateDatetimeProperty * @param dt * @param dtval * @param tzid * @throws Throwable */ public static void initDt(final DateDatetimePropertyType dt, final String dtval, final String tzid) throws Throwable { XMLGregorianCalendar xgc = fromDtval(dtval); if (dtval.length() == 8) { dt.setDate(xgc); return; } dt.setDateTime(xgc); if (dtval.endsWith("Z") || (tzid == null)) { return; } TzidParamType tz = new TzidParamType(); tz.setText(tzid); ArrayOfParameters aop = dt.getParameters(); if (aop == null) { aop = new ArrayOfParameters(); dt.setParameters(aop); } aop.getBaseParameter().add(icalOf.createTzid(tz)); dt.setParameters(aop); }
TzidParamType tzid = new TzidParamType(); tzid.setText(param.getValue()); return of.createTzid(tzid);