Package org.apache.tika.sax
Class LinkContentHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.tika.sax.LinkContentHandler
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.ErrorHandler
public class LinkContentHandler extends org.xml.sax.helpers.DefaultHandler
Content handler that collects links from an XHTML document.
-
-
Constructor Summary
Constructors Constructor Description LinkContentHandler()
Default constructorLinkContentHandler(boolean collapseWhitespaceInAnchor)
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
void
endElement(java.lang.String uri, java.lang.String local, java.lang.String name)
java.util.List<Link>
getLinks()
Returns the list of collected links.void
ignorableWhitespace(char[] ch, int start, int length)
void
startElement(java.lang.String uri, java.lang.String local, java.lang.String name, org.xml.sax.Attributes attributes)
-
-
-
Method Detail
-
getLinks
public java.util.List<Link> getLinks()
Returns the list of collected links.- Returns:
- collected links
-
startElement
public void startElement(java.lang.String uri, java.lang.String local, java.lang.String name, org.xml.sax.Attributes attributes)
- Specified by:
startElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startElement
in classorg.xml.sax.helpers.DefaultHandler
-
characters
public void characters(char[] ch, int start, int length)
- Specified by:
characters
in interfaceorg.xml.sax.ContentHandler
- Overrides:
characters
in classorg.xml.sax.helpers.DefaultHandler
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length)
- Specified by:
ignorableWhitespace
in interfaceorg.xml.sax.ContentHandler
- Overrides:
ignorableWhitespace
in classorg.xml.sax.helpers.DefaultHandler
-
endElement
public void endElement(java.lang.String uri, java.lang.String local, java.lang.String name)
- Specified by:
endElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endElement
in classorg.xml.sax.helpers.DefaultHandler
-
-