Class Extractor

    • Method Detail

      • getLinkHandler

        @Nonnull
        public LinkHandler getLinkHandler()
        Returns:
        The LinkHandler of the current extractor object (e.g. a ChannelExtractor should return a channel url handler).
      • fetchPage

        public void fetchPage()
                       throws java.io.IOException,
                              ExtractionException
        Fetch the current page.
        Throws:
        java.io.IOException - if the page can not be loaded
        ExtractionException - if the pages content is not understood
      • assertPageFetched

        protected void assertPageFetched()
      • isPageFetched

        protected boolean isPageFetched()
      • onFetchPage

        public abstract void onFetchPage​(@Nonnull
                                         Downloader downloader)
                                  throws java.io.IOException,
                                         ExtractionException
        Fetch the current page.
        Parameters:
        downloader - the downloader to use
        Throws:
        java.io.IOException - if the page can not be loaded
        ExtractionException - if the pages content is not understood
      • getName

        @Nonnull
        public abstract java.lang.String getName()
                                          throws ParsingException
        Get the name
        Returns:
        the name
        Throws:
        ParsingException - if the name cannot be extracted
      • getServiceId

        public int getServiceId()
      • getDownloader

        public Downloader getDownloader()
      • forceLocalization

        public void forceLocalization​(Localization localization)
      • forceContentCountry

        public void forceContentCountry​(ContentCountry contentCountry)
      • getExtractorLocalization

        @Nonnull
        public Localization getExtractorLocalization()
      • getExtractorContentCountry

        @Nonnull
        public ContentCountry getExtractorContentCountry()
      • getTimeAgoParser

        @Nonnull
        public TimeAgoParser getTimeAgoParser()