下面是一个搜索引擎中的一个接口/* Copyright (c) 2004 The Nutch Organization. All rights reserved. */
/* Use subject to the conditions in http://www.nutch.org/LICENSE.txt. */package net.nutch.parse;import net.nutch.protocol.Content;/** A parser for content generated by a {@link net.nutch.protocol.Protocol}
* implementation. This interface is implemented by extensions. Nutch's core
* contains no page parsing code. */
//对net.nutch.protocol.Protocol构造的content分词,由子类实现, Nutch的核心部分不含页面的分词的实现代码
public interface Parser {
/** The name of the extension point. */
public final static String X_POINT_ID = Parser.class.getName(); //分词器名
/** Creates the parse for some content. */
Parse getParse(Content c) throws ParseException; //getParse
}
请问大家Parser.class.getName()怎么理解?
Parser并没有class这个静态变量啊,getname()方法又是那里来的?
/* Use subject to the conditions in http://www.nutch.org/LICENSE.txt. */package net.nutch.parse;import net.nutch.protocol.Content;/** A parser for content generated by a {@link net.nutch.protocol.Protocol}
* implementation. This interface is implemented by extensions. Nutch's core
* contains no page parsing code. */
//对net.nutch.protocol.Protocol构造的content分词,由子类实现, Nutch的核心部分不含页面的分词的实现代码
public interface Parser {
/** The name of the extension point. */
public final static String X_POINT_ID = Parser.class.getName(); //分词器名
/** Creates the parse for some content. */
Parse getParse(Content c) throws ParseException; //getParse
}
请问大家Parser.class.getName()怎么理解?
Parser并没有class这个静态变量啊,getname()方法又是那里来的?
Interface ParserAll Known Implementing Classes:
HtmlParser, MP3Parser, MSWordParser, PdfParser, RTFParseFactory, TextParser --------------------------------------------------------------------------------public interface Parser
A parser for content generated by a Protocol implementation. This interface is implemented by extensions. Nutch's core contains no page parsing code.
--------------------------------------------------------------------------------Field Summary
static String X_POINT_ID
The name of the extension point. Method Summary
Parse getParse(Content c)
Creates the parse for some content.
Field Detail X_POINT_ID
public static final String X_POINT_IDThe name of the extension point. Method Detail getParse
public Parse getParse(Content c)
throws ParseExceptionCreates the parse for some content. Throws:
ParseException
总觉得不是静态变量不能这样调用的!