Class RegexRule

java.lang.Object
org.archive.modules.canonicalize.BaseRule
org.archive.modules.canonicalize.RegexRule
All Implemented Interfaces:
Serializable, CanonicalizationRule, org.archive.spring.HasKeyedProperties

public class RegexRule
extends BaseRule
General conversion rule.
Version:
$Date$, $Revision$
Author:
stack
See Also:
Serialized Form
  • Field Details

    • logger

      protected static Logger logger
  • Constructor Details

    • RegexRule

      public RegexRule()
  • Method Details

    • getRegex

      public Pattern getRegex()
    • setRegex

      public void setRegex​(Pattern regex)
      The regular expression to use to match.
    • getFormat

      public String getFormat()
    • setFormat

      public void setFormat​(String format)
      The format string to use when a match is found.
    • canonicalize

      public String canonicalize​(String url)
      Description copied from interface: CanonicalizationRule
      Apply this canonicalization rule.
      Parameters:
      url - Url string we apply this rule to.
      Returns:
      Result of applying this rule to passed url.