Package org.apache.tika.sax
Class LinkContentHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.tika.sax.LinkContentHandler
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
Content handler that collects links from an XHTML document.
-
Constructor Summary
ConstructorDescriptionDefault constructorLinkContentHandler
(boolean collapseWhitespaceInAnchor) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] ch, int start, int length) void
endElement
(String uri, String local, String name) getLinks()
Returns the list of collected links.void
ignorableWhitespace
(char[] ch, int start, int length) void
startElement
(String uri, String local, String name, Attributes attributes) Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
LinkContentHandler
public LinkContentHandler()Default constructor -
LinkContentHandler
public LinkContentHandler(boolean collapseWhitespaceInAnchor) Default constructor- Parameters:
collapseWhitespaceInAnchor
-
-
-
Method Details
-
getLinks
Returns the list of collected links.- Returns:
- collected links
-
startElement
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
-
characters
public void characters(char[] ch, int start, int length) - Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) - Specified by:
ignorableWhitespace
in interfaceContentHandler
- Overrides:
ignorableWhitespace
in classDefaultHandler
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
-