Commit e046bb07 authored by yihua.huang's avatar yihua.huang

remove useless code

parent 6e32a19f
......@@ -15,7 +15,7 @@ public class ResultItemsCollectorPipeline implements CollectorPipeline<ResultIte
private List<ResultItems> collector = new ArrayList<ResultItems>();
@Override
public void process(ResultItems resultItems, Task task) {
public synchronized void process(ResultItems resultItems, Task task) {
collector.add(resultItems);
}
......
package us.codecraft.webmagic.model.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Define the url patterns for class. <br>
* All urls matching the pattern will be crawled and extracted for new objects. <br>
*
* @author code4crafter@gmail.com <br>
* @since 0.3.3
*/
@Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface UrlTemplate {
/**
* The url patterns for class.<br>
* Use regex expression with some changes: <br>
* "." stand for literal character "." instead of "any character". <br>
* "*" stand for any legal character for url in 0-n length ([^"'#]*) instead of "any length". <br>
*
* @return the url patterns for class
*/
String value();
/**
* Define the region for url extracting. <br>
* Only support XPath.<br>
* When sourceRegion is set, the urls will be extracted only from the region instead of entire content. <br>
*
* @return the region for url extracting
*/
String encoding() default "utf8";
}
package us.codecraft.webmagic.model.direct;
import java.util.LinkedHashMap;
/**
* @author code4crafter@gmail.com
*/
public class Param extends LinkedHashMap<String,Object>{
@Override
public Param put(String key, Object value) {
super.put(key, value);
return this;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment