Exemplo n.º 1
0
  static void processParameters(final ParameterList icparams, final BasePropertyType prop)
      throws Throwable {
    if ((icparams == null) || icparams.isEmpty()) {
      return;
    }

    final Iterator it = icparams.iterator();

    while (it.hasNext()) {
      final Parameter param = (Parameter) it.next();

      final ParameterInfoIndex pii = ParameterInfoIndex.lookupPname(param.getName());

      if (pii == null) {
        continue;
      }

      final JAXBElement<? extends BaseParameterType> xmlprop = doParameter(param, pii);

      if (xmlprop != null) {
        if (prop.getParameters() == null) {
          prop.setParameters(new ArrayOfParameters());
        }

        prop.getParameters().getBaseParameter().add(xmlprop);
      }
    }
  }
Exemplo n.º 2
0
  private static String paramVal(final Property p, final String paramName) {
    Parameter param = p.getParameter(paramName);

    if ((param == null) || (param.getValue() == null)) {
      return null;
    }

    return param.getValue();
  }
Exemplo n.º 3
0
  static JAXBElement<? extends BaseParameterType> doParameter(
      final Parameter param, final ParameterInfoIndex pii) throws Throwable {
    switch (pii) {
      case ALTREP:
        AltrepParamType ar = new AltrepParamType();
        ar.setUri(param.getValue());
        return of.createAltrep(ar);

      case CN:
        CnParamType cn = new CnParamType();
        cn.setText(param.getValue());
        return of.createCn(cn);

      case CUTYPE:
        CutypeParamType c = new CutypeParamType();
        c.setText(param.getValue());
        return of.createCutype(c);

      case DELEGATED_FROM:
        DelegatedFromParamType df = new DelegatedFromParamType();
        df.getCalAddress().add(param.getValue());
        return of.createDelegatedFrom(df);

      case DELEGATED_TO:
        DelegatedToParamType dt = new DelegatedToParamType();
        dt.getCalAddress().add(param.getValue());
        return of.createDelegatedTo(dt);

      case DIR:
        DirParamType d = new DirParamType();
        d.setUri(param.getValue());
        return of.createDir(d);

      case ENCODING:
        return null;

      case FMTTYPE:
        return null;

      case FBTYPE:
        return null;

      case LANGUAGE:
        LanguageParamType l = new LanguageParamType();
        l.setText(param.getValue());
        return of.createLanguage(l);

      case MEMBER:
        MemberParamType m = new MemberParamType();
        m.getCalAddress().add(param.getValue());
        return of.createMember(m);

      case PARTSTAT:
        PartstatParamType partstat = new PartstatParamType();
        partstat.setText(param.getValue());
        return of.createPartstat(partstat);

      case RANGE:
        return null;

      case RELATED:
        return null;

      case RELTYPE:
        return null;

      case ROLE:
        RoleParamType r = new RoleParamType();
        r.setText(param.getValue());
        return of.createRole(r);

      case RSVP:
        return null;

      case SCHEDULE_AGENT:
        return null;

      case SCHEDULE_STATUS:
        ScheduleStatusParamType ss = new ScheduleStatusParamType();
        ss.setText(param.getValue());
        return of.createScheduleStatus(ss);

      case SENT_BY:
        SentByParamType sb = new SentByParamType();
        sb.setCalAddress(param.getValue());
        return of.createSentBy(sb);

      case TYPE:
        return null;

      case TZID:
        TzidParamType tzid = new TzidParamType();
        tzid.setText(param.getValue());
        return of.createTzid(tzid);

      case VALUE:
        return null;

      default:
    } // switch (pii)

    return null;
  }