@Override public String getAnnotation(int pos, String key) { return doc.getAnnotation(pos, key); }
@Override public String getAnnotation(int start, String key) { return doc.getAnnotation(start, key); }
@Override public void apply(String key) { annotOp.startAnnotation(key, null, doc.getAnnotation(removeStart, key)); } });
/** * @return The title from the given document */ @SuppressWarnings("deprecation") public static <N, E extends N, T extends N> String extractTitle(ReadableWDocument<N, E, T> doc) { int start = doc.firstAnnotationChange(0, doc.size(), TITLE_KEY, null); if (start == -1) { return ""; } String explicitValue = doc.getAnnotation(start, TITLE_KEY); if (!explicitValue.isEmpty()) { return explicitValue; } return DocHelper.getText(doc, start, Annotations.firstAnnotationBoundary(doc, start, doc.size(), TITLE_KEY, AUTO_VALUE)); }
Preconditions.checkPositionIndexes(currentPos, end, rangeEnd); while (currentPos < end) { String currentValue = doc.getAnnotation(currentPos, key); int nextChange = doc.firstAnnotationChange(currentPos, end, key, currentValue); if (nextChange == -1) {