简介
Configurable抽象类包含了一个爬虫配置信息对象config,爬虫其他的功能模块有可能需要用到这些配置信息。
源代码
package edu.uci.ics.crawler4j.crawler;
/**
* Several core components of crawler4j extend this class
* to make them configurable.
*
* @author Yasser Ganjisaffar [lastname at gmail dot com]
*/
// 爬虫配置的抽象类,其他的一些类需要使用到这些配置
public abstract class Configurable {
protected CrawlConfig config;
protected Configurable(CrawlConfig config) {
this.config = config;
}
public CrawlConfig getConfig() {
return config;
}
}