com.ecyrd.jspwiki
Class SearchMatcher

java.lang.Object
  extended by com.ecyrd.jspwiki.SearchMatcher

public class SearchMatcher
extends Object

SearchMatcher performs the task of matching a search query to a page's contents. This utility class is isolated to simplify WikiPageProvider implementations and to offer an easy target for upgrades. The upcoming(?) TranslatorReader rewrite will presumably invalidate this, among other things.

Since:
2.1.5
Author:
ebu at ecyrd dot com

Nested Class Summary
 class SearchMatcher.SearchResultImpl
           
 
Constructor Summary
SearchMatcher(WikiEngine engine, QueryItem[] queries)
           
 
Method Summary
 SearchResult matchPageContent(String wikiname, String pageText)
          Compares the page content, available through the given stream, to the query items of this matcher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchMatcher

public SearchMatcher(WikiEngine engine,
                     QueryItem[] queries)
Method Detail

matchPageContent

public SearchResult matchPageContent(String wikiname,
                                     String pageText)
                              throws IOException
Compares the page content, available through the given stream, to the query items of this matcher. Returns a search result object describing the quality of the match.

This method would benefit of regexps (1.4) and streaming. FIXME!

Throws:
IOException