/** * Creates an agent property. * @param url a URL pointing to the agent's information */ public Agent(String url) { setUrl(url); }
@Override protected Agent _parseHtml(HCardElement element, ParseContext context) { Agent property = new Agent(); Set<String> classes = element.classNames(); if (classes.contains("vcard")) { throw new EmbeddedVCardException(new Injector(property)); } String url = element.absUrl("href"); if (url.length() == 0) { url = element.value(); } property.setUrl(url); return property; }
@Override protected Agent _parseText(String value, VCardDataType dataType, VCardParameters parameters, ParseContext context) { Agent property = new Agent(); if (dataType == null) { throw new EmbeddedVCardException(new Injector(property)); } property.setUrl(VObjectPropertyValues.unescape(value)); return property; }