01: package com.canoo.webtest.plugins.pdftest.htmlunit.pdfbox;
02:
03: import com.canoo.webtest.plugins.pdftest.htmlunit.PDFLink;
04:
05: /**
06: * Implementation of {@link PDFLink} based on
07: * <a href="http://www.pdfbox.org/">PDFBox</a>.
08: * @author Etienne Studer
09: * @author Marc Guillemot
10: */
11: public class PDFBoxPDFLink implements PDFLink {
12: private final String text_;
13: private final String href_;
14: private final int page_;
15:
16: public PDFBoxPDFLink(final String text, final String href,
17: final int page) {
18: text_ = text;
19: href_ = href;
20: page_ = page;
21: }
22:
23: public String getHref() {
24: return href_;
25: }
26:
27: public int getPage() {
28: return page_;
29: }
30:
31: public String getText() {
32: return text_;
33: }
34:
35: /**
36: * Returns information for debug purpose
37: */
38: public String toString() {
39: final StringBuffer sb = new StringBuffer("PDFBoxPDFLink(");
40: sb.append("href: ");
41: sb.append(getHref());
42: sb.append(", page: ");
43: sb.append(getPage());
44: sb.append(", text: ");
45: sb.append(getText());
46: sb.append(")@");
47: sb.append(System.identityHashCode(this));
48: return sb.toString();
49: }
50: }
|