org.apache.nutch.parse
Class ParserFactory

java.lang.Object
  extended byorg.apache.nutch.parse.ParserFactory

public class ParserFactory
extends Object

Creates and caches Parser plugins.


Field Summary
static Logger LOG
           
 
Method Summary
static Parser getParser(String contentType, String url)
          Returns the appropriate Parser implementation given a content type and url.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final Logger LOG
Method Detail

getParser

public static Parser getParser(String contentType,
                               String url)
                        throws ParserNotFound
Returns the appropriate Parser implementation given a content type and url.

Parser extensions should define the attributes"contentType" and/or "pathSuffix". Content type has priority: the first plugin found whose "contentType" attribute matches the beginning of the content's type is used. If none match, then the first whose "pathSuffix" attribute matches the end of the url's path is used. If neither of these match, then the first plugin whose "pathSuffix" is the empty string is used.

Throws:
ParserNotFound


Copyright © 2006 The Apache Software Foundation