Search in sources :

Example 1 with ParameterInfoIndex

use of org.bedework.util.calendar.PropertyIndex.ParameterInfoIndex in project bw-calendar-engine by Bedework.

the class IcalTranslator method xmlParameter.

private void xmlParameter(final XmlEmit xml, final Parameter val) throws CalFacadeException {
    try {
        ParameterInfoIndex pii = ParameterInfoIndex.lookupPname(val.getName());
        QName ptype = XcalTags.textVal;
        if (pii != null) {
            DataType dtype = pii.getPtype();
            if (dtype != null) {
                ptype = dtype.getXcalType();
            }
        }
        if (ptype.equals(XcalTags.textVal)) {
            QName tag = new QName(XcalTags.namespace, val.getName().toLowerCase());
            xml.property(tag, val.getValue());
        } else {
            QName tag = openTag(xml, val.getName());
            xml.property(ptype, val.getValue());
            xml.closeTag(tag);
        }
    } catch (CalFacadeException cfe) {
        throw cfe;
    } catch (Throwable t) {
        throw new CalFacadeException(t);
    }
}
Also used : QName(javax.xml.namespace.QName) ParameterInfoIndex(org.bedework.util.calendar.PropertyIndex.ParameterInfoIndex) DataType(org.bedework.util.calendar.PropertyIndex.DataType) CalFacadeException(org.bedework.calfacade.exc.CalFacadeException)

Aggregations

QName (javax.xml.namespace.QName)1 CalFacadeException (org.bedework.calfacade.exc.CalFacadeException)1 DataType (org.bedework.util.calendar.PropertyIndex.DataType)1 ParameterInfoIndex (org.bedework.util.calendar.PropertyIndex.ParameterInfoIndex)1