/** * Unmarshals a property's value from a JSON data stream (jCard). * @param value the property's JSON value * @param dataType the data type * @param parameters the parsed parameters * @param context the parse context * @return the unmarshalled property * @throws CannotParseException if the marshaller could not parse the * property's value * @throws SkipMeException if the property should not be added to the final * {@link VCard} object */ public final T parseJson(JCardValue value, VCardDataType dataType, VCardParameters parameters, ParseContext context) { T property = _parseJson(value, dataType, parameters, context); property.setParameters(parameters); return property; }
/** * Unmarshals a property from a plain-text vCard. * @param value the value as read off the wire * @param dataType the data type of the property value. The property's VALUE * parameter is used to determine the data type. If the property has no * VALUE parameter, then this parameter will be set to the property's * default datatype, as determined by the {@link #defaultDataType} method. * Note that the VALUE parameter is removed from the property's parameter * list after it has been read. * @param parameters the parsed parameters * @param context the parse context * @return the unmarshalled property * @throws CannotParseException if the marshaller could not parse the * property's value * @throws SkipMeException if the property should not be added to the final * {@link VCard} object * @throws EmbeddedVCardException if the property value is an embedded vCard * (i.e. the AGENT property) */ public final T parseText(String value, VCardDataType dataType, VCardParameters parameters, ParseContext context) { T property = _parseText(value, dataType, parameters, context); property.setParameters(parameters); return property; }
/** * Unmarshals a property's value from an XML document (xCard). * @param element the property's XML element * @param parameters the parsed parameters * @param context the parse context * @return the unmarshalled property * @throws CannotParseException if the marshaller could not parse the * property's value * @throws SkipMeException if the property should not be added to the final * {@link VCard} object */ public final T parseXml(Element element, VCardParameters parameters, ParseContext context) { T property = _parseXml(new XCardElement(element), parameters, context); property.setParameters(parameters); return property; }
/** * <p> * Unmarshals the property from an hCard (HTML document). * </p> * <p> * This method should be overridden by child classes that wish to support * hCard. The default implementation of this method will retrieve the HTML * element's hCard value (as described in {@link HCardElement#value}), and * pass it into the {@link #_parseText} method. * </p> * @param element the property's HTML element * @param context the parse context * @return the unmarshalled property object * @throws CannotParseException if the property value could not be parsed * @throws SkipMeException if this property should NOT be added to the * {@link VCard} object * @throws EmbeddedVCardException if the value of this property is an * embedded vCard (i.e. the AGENT property) */ protected T _parseHtml(HCardElement element, ParseContext context) { String value = VObjectPropertyValues.escape(element.value()); VCardParameters parameters = new VCardParameters(); T property = _parseText(value, null, parameters, context); property.setParameters(parameters); return property; }