if (contact instanceof Phone) {
span.addChild(new HtmlText(((Phone) contact).getNumber()));
} else if (contact instanceof MobilePhone) {
span.addChild(new HtmlText(((MobilePhone) contact).getNumber()));
} else if (contact instanceof EmailAddress) {
EmailAddress email = (EmailAddress) contact;
if (isPublicSpace()) {
HtmlImage img = new HtmlImage();
img.setSource(RenderUtils.getContextRelativePath("") + "/publico/viewHomepage.do?method=emailPng&email="
+ email.getExternalId());
span.addChild(img);
} else {
HtmlLink link = new HtmlLink();
link.setModuleRelative(false);
link.setContextRelative(false);
link.setUrl("mailto:" + email.getValue());
link.setBody(new HtmlText(email.getValue()));
span.addChild(link);
}
} else if (contact instanceof WebAddress) {
HtmlLink link = new HtmlLink();
link.setModuleRelative(false);