- All Implemented Interfaces:
public class SpiderExtension extends Object implements ReportFactoryExtension
A ReportFactoryExtension that will listen for any hyperlinks in the document, consider whether the document being linked to is "local" and if it is, attach it to the PDF as another PDF and redirect all links to that document. This allows you to build up a single PDF that contains an entire folder or website.
Nested Class SummaryModifier and TypeClassDescription
static final classAn internal helper class for SpiderExtension
Method SummaryModifier and TypeMethodDescription
booleanReturn true if a target URL is considered "local" for the base URL, and therefore attachable.
(SpiderExtension.State state)Called whenever a hyperlink to an external resource is added to a Report.
(Report report)Notify this object when the Report it was registered on has completed parsing.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.faceless.publisher.ext.ReportFactoryExtension
load, register, register, unregister
unregisterpublic void unregister
(Report report)Description copied from interface:
ReportFactoryExtensionNotify this object when the Report it was registered on has completed parsing. Will be called when this object is added to the list returned by
ReportFactory.getReportFactoryExtensions. The default implementation is a no-op.
- Specified by:
startDocumentpublic void startDocument
- Specified by:
processpublic Report process
(SpiderExtension.State state)Called whenever a hyperlink to an external resource is added to a Report. Attachments can be made by returning the report to attach the document at the target URL to, or calling state.addAttachment directly. The defaut implementation attaches the PDF to the top document in the stack if "isLocal" returns true.
state- the current state.
- the report to attach the resource to, or null to not attach anything.
isLocalReturn true if a target URL is considered "local" for the base URL, and therefore attachable.