"displayText");
}
Class propertyClass = propertyConfig.getPropertyClassObject();
String propertyCode = propertyConfig.getCode();
TextHandler textExtractor = new TextHandler();
Object property = entity.getProperty(propertyCode);
String link;
String linkDisplayText;
if (entity != null) {
if (propertyClass == URL.class) {
URL url = (URL) property;
if (url == null) {
link = "";
} else {
link = url.toString();
}
if (displayText == null) {
linkDisplayText = textExtractor
.extractBeginPlusThreeDots(link,
App.SHORT_TEXT_LENGTH);
} else {
linkDisplayText = displayText;
}
externalLink = new ExternalLink("propertyValue", link,
linkDisplayText);
add(externalLink);
} else if (propertyClass == Email.class) {
Email email = (Email) property;
if (email == null) {
link = "";
} else {
link = email.toString();
}
if (displayText == null) {
linkDisplayText = textExtractor
.extractBeginPlusThreeDots(link,
App.SHORT_TEXT_LENGTH);
} else {
linkDisplayText = displayText;
}
externalLink = new ExternalLink("propertyValue", "mailto: " + link,
linkDisplayText);
add(externalLink);
} else if (propertyClass == String.class) {
link = (String) property;
if (link == null) {
link = "";
}
if (propertyConfig.getValidationType()
.equals("java.net.URL")) {
if (displayText == null) {
linkDisplayText = textExtractor
.extractBeginPlusThreeDots(link,
App.SHORT_TEXT_LENGTH);
} else {
linkDisplayText = displayText;
}
externalLink = new ExternalLink("propertyValue", link,
linkDisplayText);
add(externalLink);
} else if (propertyConfig.getValidationType().equals(
"org.dmlite.type.email.Email")) {
if (displayText == null) {
linkDisplayText = textExtractor
.extractBeginPlusThreeDots(link,
App.SHORT_TEXT_LENGTH);
} else {
linkDisplayText = displayText;
}