org.apache.nutch.parse

## Class ParseUtil

- java.lang.Object
- - org.apache.hadoop.conf.Configured
  - - org.apache.nutch.parse.ParseUtil

- All Implemented Interfaces:
    Configurable

      public class ParseUtil
      extends Configured

  A Utility class containing methods to simply perform parsing utilities such as iterating through a preferred list of `Parser`s to obtain `Parse` objects.
  Author:
    mattmann, Jérôme Charron, Sébastien Le Callonnec

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ParseUtil.ChangeFrequency`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ParseUtil(Configuration conf)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Configuration` | `getConf()`
    `Parse` | `parse(java.lang.String url, WebPage page)` Performs a parse by iterating through a List of preferred `Parser`s until a successful parse is performed and a `Parse` object is returned.
    `void` | `process(java.lang.String url, WebPage page)` Parses given web page and stores parsed content within page.
    `void` | `processSitemapParse(java.lang.String url, WebPage page, Mapper.Context context)` Parses given sitemap page and stores parsed content within page.
    `void` | `setConf(Configuration conf)`
    `boolean` | `status(java.lang.String url, WebPage page)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ParseUtil

          public ParseUtil(Configuration conf)

      Parameters:
        `conf` -

  - ### Method Detail

    - #### getConf

          public Configuration getConf()

      Specified by:
        `getConf` in interface `Configurable`
      Overrides:
        `getConf` in class `Configured`

    - #### setConf

          public void setConf(Configuration conf)

      Specified by:
        `setConf` in interface `Configurable`
      Overrides:
        `setConf` in class `Configured`

    - #### parse

          public Parse parse(java.lang.String url,
                             WebPage page)
                      throws ParseException

      Performs a parse by iterating through a List of preferred `Parser`s until a successful parse is performed and a `Parse` object is returned. If the parse is unsuccessful, a message is logged to the `WARNING` level, and an empty parse is returned.
      Throws:
        `ParserNotFound` - If there is no suitable parser found.
        `ParseException` - If there is an error parsing.

    - #### status

          public boolean status(java.lang.String url,
                                WebPage page)

    - #### processSitemapParse

          public void processSitemapParse(java.lang.String url,
                                          WebPage page,
                                          Mapper.Context context)

      Parses given sitemap page and stores parsed content within page.

    - #### process

          public void process(java.lang.String url,
                              WebPage page)

      Parses given web page and stores parsed content within page. Puts a meta-redirect to outlinks.
      Parameters:
        `url` -
        `page` -

Copyright © 2019 The Apache Software Foundation