public void processLink(Locator locator, String href) { if ((locator.getDocumentOffset() < offset) || (locator.getDocumentOffset() >= (offset + length))) { return; } if (href.length() > 0 && href.charAt(0) == '#') { if (references == null) { references = new ArrayList<LocalReference>(); } String name = href.substring(1); int length = locator.getLineSegmentEndOffset() - locator.getLineCharacterOffset(); references.add(new LocalReference(name, locator.getDocumentOffset(), length)); } } }
private IRegion createRegion() { int offset = getLocator().getLineCharacterOffset(); int length = getLocator().getLineSegmentEndOffset() - offset; return new Region(offset, length); }
public LocatorImpl(Locator other) { documentOffset = other.getDocumentOffset(); lineCharacterOffset = other.getLineCharacterOffset(); lineDocumentOffset = other.getLineDocumentOffset(); lineLength = other.getLineLength(); lineNumber = other.getLineNumber(); lineSegmentEndOffset = other.getLineSegmentEndOffset(); }
@Override public void beginSpan(SpanType type, Attributes attributes) { Span span = new Span(type, attributes, getLocator().getDocumentOffset() + offset, getLocator().getLineSegmentEndOffset() - getLocator().getLineCharacterOffset()); if (currentSpan != null) { currentSpan.add(span); currentSpan = span; } else { currentSpan = span; currentBlock.add(span); } }