Regain 2.1.0-STABLE API

net.sf.regain.crawler.config
Class RegexUrlMatcher

java.lang.Object
  extended by net.sf.regain.crawler.config.UrlMatcherResult
      extended by net.sf.regain.crawler.config.RegexUrlMatcher
All Implemented Interfaces:
UrlMatcher

public class RegexUrlMatcher
extends UrlMatcherResult

An UrlMatcher that matches URLs that match to a regular expression.

Author:
Tilman Schneider, STZ-IDA an der FH Karlsruhe

Field Summary
private static org.apache.log4j.Logger mLog
          The logger for this class.
private  java.util.regex.Pattern mUrlRegex
          The regex a URL must match to in order to be matched by this matcher.
private  String mUrlRegexAsString
          The regex as String.
 
Constructor Summary
RegexUrlMatcher(String regex, boolean shouldBeParsed, boolean shouldBeIndexed)
          Creates a new instance of RegexUrlMatcher.
 
Method Summary
 boolean matches(String url)
          Checks whether a URL matches to the rules of this matcher.
 String toString()
          Gets a String representation of this UrlMatcher.
 
Methods inherited from class net.sf.regain.crawler.config.UrlMatcherResult
getShouldBeIndexed, getShouldBeParsed, setShouldBeIndexed, setShouldBeParsed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mLog

private static org.apache.log4j.Logger mLog
The logger for this class.


mUrlRegexAsString

private String mUrlRegexAsString
The regex as String.


mUrlRegex

private java.util.regex.Pattern mUrlRegex
The regex a URL must match to in order to be matched by this matcher.

Constructor Detail

RegexUrlMatcher

public RegexUrlMatcher(String regex,
                       boolean shouldBeParsed,
                       boolean shouldBeIndexed)
                throws RegainException
Creates a new instance of RegexUrlMatcher.

Parameters:
regex - The regular expression a URL must match to in order to be matched by this matcher.
Throws:
RegainException
Method Detail

matches

public boolean matches(String url)
Checks whether a URL matches to the rules of this matcher.

Specified by:
matches in interface UrlMatcher
Overrides:
matches in class UrlMatcherResult
Parameters:
url - The URL to check.
Returns:
Whether the given URL matches to the rules of this matcher.

toString

public String toString()
Gets a String representation of this UrlMatcher.

Overrides:
toString in class Object

Regain 2.1.0-STABLE API

Regain 2.1.0-STABLE, Copyright (C) 2004-2010 Til Schneider, www.murfman.de, Thomas Tesche, www.clustersystems.info