Package 

Class FeaturedDocument


  • 
    public class FeaturedDocument
    
                        

    The featured document.

    A "featured document" is "very important" and all its features are calculated.

    • Constructor Detail

      • FeaturedDocument

        FeaturedDocument(String baseUri)
      • FeaturedDocument

        FeaturedDocument(Document document)
    • Method Detail

      • unbox

         final Document unbox()
      • guessTitle

         final String guessTitle()

        The title should be guessed for some site without a <title> tag inside a <head> tag

      • absoluteLinks

         final Unit absoluteLinks()

        Make all links in the document to be absolute.

      • select

        @JvmOverloads() final Elements select(String query, Integer offset, Integer limit)

        Find elements that match the CSS query, with the document as the starting context. Matched elements may include the document, or any of its children.

        <p>This method is generally more powerful to use than the DOM-type {@code getElementBy*} methods, because multiple filters can be combined, e.g.:</p>
      • select

        @JvmOverloads() final Elements select(String query, Integer offset)

        Find elements that match the CSS query, with the document as the starting context. Matched elements may include the document, or any of its children.

        <p>This method is generally more powerful to use than the DOM-type {@code getElementBy*} methods, because multiple filters can be combined, e.g.:</p>
      • select

        @JvmOverloads() final Elements select(String query)

        Find elements that match the CSS query, with the document as the starting context. Matched elements may include the document, or any of its children.

        <p>This method is generally more powerful to use than the DOM-type {@code getElementBy*} methods, because multiple filters can be combined, e.g.:</p>
      • select

         final <T extends Any> List<T> select(String query, Integer offset, Integer limit, Function1<Element, T> transformer)

        Find elements that match the CSS query, with the document as the starting context. Matched elements may include the document, or any of its children.

        <p>This method is generally more powerful to use than the DOM-type {@code getElementBy*} methods, because multiple filters can be combined, e.g.:</p>
      • selectFirst

         final Element selectFirst(String query)

        Find the first element that match the CSS query, with the document as the starting context. Matched element may be the document, or any of its children.

        <p>This method is generally more powerful to use than the DOM-type {@code getElementBy*} methods, because multiple filters can be combined, e.g.:</p>
      • selectFirst

         final <T extends Any> T selectFirst(String query, Function1<Element, T> transformer)

        Find the first element that match the CSS query, with the document as the starting context. Matched element may be the document, or any of its children.

        <p>This method is generally more powerful to use than the DOM-type {@code getElementBy*} methods, because multiple filters can be combined, e.g.:</p>
      • selectFirstOrNull

         final Element selectFirstOrNull(String query)

        Find the first element that match the CSS query, with the document as the starting context. Matched element may be the document, or any of its children.

        <p>This method is generally more powerful to use than the DOM-type {@code getElementBy*} methods, because multiple filters can be combined, e.g.:</p>
      • selectFirstOrNull

         final <T extends Any> T selectFirstOrNull(String query, Function1<Element, T> transformer)

        Find the first element that match the CSS query, with the document as the starting context. Matched element may be the document, or any of its children.

        <p>This method is generally more powerful to use than the DOM-type {@code getElementBy*} methods, because multiple filters can be combined, e.g.:</p>
      • selectFirstOptional

         final Optional<Element> selectFirstOptional(String query)

        Find elements that match the CSS query, with the document as the starting context. Matched elements may include the document, or any of its children.

        <p>This method is generally more powerful to use than the DOM-type {@code getElementBy*} methods, because multiple filters can be combined, e.g.:</p>

        Return the first element, if no element matches the query, return an Optional object.

      • selectFirstOptional

         final <T extends Any> Optional<T> selectFirstOptional(String query, Function1<Element, T> transformer)

        Find elements that match the CSS query, with the document as the starting context. Matched elements may include the document, or any of its children.

        <p>This method is generally more powerful to use than the DOM-type {@code getElementBy*} methods, because multiple filters can be combined, e.g.:</p>

        Return the first element, if no element matches the query, return an Optional object.

      • selectHyperlinks

        @JvmOverloads() final List<Hyperlink> selectHyperlinks(String query, Integer offset, Integer limit)

        Find hyperlinks in elements that match the CSS query, with the document as the starting context. Matched elements may include the document, or any of its children.

        <p>This method is generally more powerful to use than the DOM-type {@code getElementBy*} methods, because multiple filters can be combined, e.g.:</p>
      • selectHyperlinks

        @JvmOverloads() final List<Hyperlink> selectHyperlinks(String query, Integer offset)

        Find hyperlinks in elements that match the CSS query, with the document as the starting context. Matched elements may include the document, or any of its children.

        <p>This method is generally more powerful to use than the DOM-type {@code getElementBy*} methods, because multiple filters can be combined, e.g.:</p>
      • selectHyperlinks

        @JvmOverloads() final List<Hyperlink> selectHyperlinks(String query)

        Find hyperlinks in elements that match the CSS query, with the document as the starting context. Matched elements may include the document, or any of its children.

        <p>This method is generally more powerful to use than the DOM-type {@code getElementBy*} methods, because multiple filters can be combined, e.g.:</p>
      • first

        @Deprecated(message = Inappropriate name, replaceWith = @ReplaceWith(imports = {}, expression = selectFirst(query, transformer))) final <T extends Any> T first(String query, Function1<Element, T> transformer)
      • firstText

         final String firstText(String query)

        Find the text content of the first element that match the CSS query, with the document as the starting context. Matched element may be the document, or any of its children.

      • firstTextOrNull

         final String firstTextOrNull(String query)

        Find the text content of the first element that match the CSS query, with the document as the starting context. Matched element may be the document, or any of its children.

      • firstTextOptional

         final Optional<String> firstTextOptional(String query)

        Find the text content of the first element that match the CSS query, with the document as the starting context. Matched element may be the document, or any of its children.

      • firstAttribute

         final String firstAttribute(String query, String attrName, String defaultValue)

        Find the attribute value of the first element that match the CSS query, with the document as the starting context. Matched element may be the document, or any of its children.

      • firstAttributeOrNull

         final String firstAttributeOrNull(String query, String attrName)

        Find the attribute value of the first element that match the CSS query, with the document as the starting context. Matched element may be the document, or any of its children.

      • firstAttributeOptional

         final Optional<String> firstAttributeOptional(String query, String attrName)

        Find the attribute value of the first element that match the CSS query, with the document as the starting context. Matched element may be the document, or any of its children.

      • stripScripts

         final Unit stripScripts()

        Remove all script nodes in the document.

      • stripStyles

         final Unit stripStyles()

        Remove all style nodes from the document, and remove all style attributes from all elements.

      • exportTo

         final Path exportTo(Path path)

        Export the document to the given path.