Class LinkExtractor

  • All Implemented Interfaces:
    Callback

    @Deprecated
    public class LinkExtractor
    extends DefaultCallback
    Deprecated.
    This class is obsolete and kept around for backward compatibility only.
    A callback extracting links.

    This callbacks extracts links existing in the web page. The links are then accessible in urls (a set of Strings). Note that we guarantee that the iteration order in the set is exactly the order in which links have been met (albeit copies appear just once).

    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.Set<java.lang.String> urls
      Deprecated.
      The URLs resulting from the parsing process.
    • Constructor Summary

      Constructors 
      Constructor Description
      LinkExtractor()
      Deprecated.
       
    • Field Detail

      • urls

        public final java.util.Set<java.lang.String> urls
        Deprecated.
        The URLs resulting from the parsing process.
    • Constructor Detail

      • LinkExtractor

        public LinkExtractor()
        Deprecated.
    • Method Detail

      • configure

        public void configure​(BulletParser parser)
        Deprecated.
        Configure the parser to parse elements and certain attributes.

        The required attributes are SRC , HREF , HTTP-EQUIV , and CONTENT .

        Specified by:
        configure in interface Callback
        Overrides:
        configure in class DefaultCallback
      • startDocument

        public void startDocument()
        Deprecated.
        Description copied from interface: Callback
        Receive notification of the beginning of the document.

        The callback must use this method to reset its internal state so that it can be resued. It must be safe to invoke this method several times.

        Specified by:
        startDocument in interface Callback
        Overrides:
        startDocument in class DefaultCallback
      • startElement

        public boolean startElement​(Element element,
                                    java.util.Map<Attribute,​MutableString> attrMap)
        Deprecated.
        Description copied from interface: Callback
        Receive notification of the start of an element.

        For simple elements, this is the only notification that the callback will ever receive.

        Specified by:
        startElement in interface Callback
        Overrides:
        startElement in class DefaultCallback
        Parameters:
        element - the element whose opening tag was found.
        attrMap - a map from Attributes to MutableStrings.
        Returns:
        true to keep the parser parsing, false to stop it.
      • metaLocation

        public java.lang.String metaLocation()
        Deprecated.
        Returns the URL specified by META HTTP-EQUIV elements of location type. More precisely, this method returns a non- null result iff there is at least one META HTTP-EQUIV element specifying a location URL (if there is more than one, we keep the first one).
        Returns:
        the first URL specified by a META HTTP-EQUIV elements of location type, or null.
      • base

        public java.lang.String base()
        Deprecated.
        Returns the URL specified by the BASE element. More precisely, this method returns a non- null result iff there is at least one BASE element specifying a derelativisation URL (if there is more than one, we keep the first one).
        Returns:
        the first URL specified by a BASE element, or null.
      • metaRefresh

        public java.lang.String metaRefresh()
        Deprecated.
        Returns the URL specified by META HTTP-EQUIV elements of refresh type. More precisely, this method returns a non- null result iff there is at least one META HTTP-EQUIV element specifying a refresh URL (if there is more than one, we keep the first one).
        Returns:
        the first URL specified by a META HTTP-EQUIV elements of refresh type, or null.