public interface TagHandler
TagHandlerProvider according to tag/attribute matching rules and receive callbacks from
the HTMLContentHandler while it is handling the SAX events.
Tag Handlers work in a chain of responsibility with each tag handler creating a new instance of a nested tag handler and delegating to it. Majority of the tag handlers don't have a standalone existence and work nested within other tag handlers. The tag handlers which are capable of working stand alone need to implement this interface.
| Modifier and Type | Method and Description |
|---|---|
void |
beginHandling(String uri,
String localName,
String qName,
Attributes atts)
Callback to signal the start of handling giving the tag handler a chance for running intialization routines.
|
void |
characters(char[] ch,
int start,
int length)
Callback to signal the encounter of character content within tags.
|
void |
endElement(String uri,
String localName,
String qName)
Callback to signal the encounter of a tag end.
|
void |
endHandling(String uri,
String localName,
String qName)
Callback to signal the end of handling giving the tag handler a chance for finalizing things.
|
void |
setDesignImporterContext(DesignImporterContext designImporterContext)
Sets the design importer context
|
void |
setTagHandlerProvider(TagHandlerProvider tagHandlerProvider) |
void |
startElement(String uri,
String localName,
String qName,
Attributes atts)
Callback to signal the encounter of a tag start.
|
void beginHandling(String uri, String localName, String qName, Attributes atts) throws DesignImportException
TagHandlers are registered against tag+attribute combination and are invoked by the HTMLContentHandler as and when it
encounters a tag matching the tag attribute combination the tag handler is registered with.
uri - localName - qName - atts - DesignImportExceptionvoid characters(char[] ch,
int start,
int length)
throws DesignImportException
ch - start - length - SAXExceptionDesignImportExceptionvoid endElement(String uri, String localName, String qName) throws DesignImportException
uri - localName - qName - SAXExceptionDesignImportExceptionvoid endHandling(String uri, String localName, String qName) throws DesignImportException
This is arguably the last callback a tag handler receives. After this, the current tag handler is popped out from the chain and the subsequent Tika events are directed to preceding tag handlers.
uri - localName - qName - DesignImportExceptionvoid setDesignImporterContext(DesignImporterContext designImporterContext)
designImporterContext - void setTagHandlerProvider(TagHandlerProvider tagHandlerProvider)
void startElement(String uri, String localName, String qName, Attributes atts) throws DesignImportException
Once a tag handler begins handling, it receives the start tag events for all the nested tags within the purview of the tag this tag handler is registered against.
uri - localName - qName - atts - SAXExceptionDesignImportExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved