}
String title = attributes.getProperty(ElementTags.TITLE);
String text = attributes.getProperty(ElementTags.CONTENT);
if (title != null || text != null) {
return new Annotation(title, text, llx, lly, urx, ury);
}
value = attributes.getProperty(ElementTags.URL);
if (value != null) {
return new Annotation(llx, lly, urx, ury, value);
}
value = attributes.getProperty(ElementTags.NAMED);
if (value != null) {
return new Annotation(llx, lly, urx, ury, Integer.parseInt(value));
}
String file = attributes.getProperty(ElementTags.FILE);
String destination = attributes.getProperty(ElementTags.DESTINATION);
String page = (String) attributes.remove(ElementTags.PAGE);
if (file != null) {
if (destination != null) {
return new Annotation(llx, lly, urx, ury, file, destination);
}
if (page != null) {
return new Annotation(llx, lly, urx, ury, file, Integer
.parseInt(page));
}
}
return new Annotation("", "", llx, lly, urx, ury);
}