complete docs

pull/17/head
yihua.huang 12 years ago
parent 7c0eba5e3f
commit fcfa2c30c7

@ -11,7 +11,8 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* Pipeline<br>
* PipelinePipeline<br>
* PageModelPipeline()<br>
* @author code4crafter@gmail.com <br>
* @date: 13-8-2 <br>
* Time: 10:47 <br>

@ -6,22 +6,45 @@ import java.lang.annotation.Target;
/**
* <br>
*
* @author code4crafter@gmail.com <br>
* @date: 13-8-1 <br>
* Time: 8:40 <br>
*/
@Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD,ElementType.TYPE})
@Target({ElementType.FIELD, ElementType.TYPE})
public @interface ExtractBy {
/**
*
*
* @return
*/
String value();
public enum Type {XPath, Regex, Css}
/**
* XPathCss selectorXPath
*
* @return
*/
Type type() default Type.XPath;
/**
* notNulltruefalse
*
* @return
*/
boolean notNull() default false;
/**
* <br>
* List<String><br>
* <br>
*
* @return
*/
boolean multi() default false;
}

@ -5,7 +5,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* <br>
* ExtractExtractByRaw使<br>
*
* @author code4crafter@gmail.com <br>
* @date: 13-8-1 <br>

@ -5,7 +5,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* <br>
* ExtractExtractByRaw使<br>
* @author code4crafter@gmail.com <br>
* @date: 13-8-1 <br>
* Time: 8:40 <br>

@ -6,22 +6,44 @@ import java.lang.annotation.Target;
/**
* Class使ExtractBy使<br>
*
* @author code4crafter@gmail.com <br>
* @date: 13-8-1 <br>
* Time: 8:40 <br>
*/
@Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD,ElementType.TYPE})
@Target({ElementType.FIELD, ElementType.TYPE})
public @interface ExtractByRaw {
/**
*
*
* @return
*/
String value();
public enum Type {XPath, Regex, Css}
/**
* XPathCss selectorXPath
*
* @return
*/
Type type() default Type.XPath;
/**
* notNulltruefalse
*
* @return
*/
boolean notNull() default false;
/**
* <br>
* List<String><br>
*
* @return
*/
boolean multi() default false;
}

@ -14,10 +14,27 @@ import java.lang.annotation.Target;
@Target({ElementType.FIELD})
public @interface ExtractByUrl{
/**
*
*
* @return
*/
String value() default "";
/**
* notNulltruefalse
*
* @return
*/
boolean notNull() default false;
/**
* <br>
* List<String><br>
* <br>
*
* @return
*/
boolean multi() default false;
}

@ -14,7 +14,17 @@ import java.lang.annotation.Target;
@Target({ElementType.TYPE})
public @interface HelpUrl {
/**
* URL<br>
* webmagic"."".""\*"".\*""http://\*.oschina.net/\*"oschinaURL<br>
*
* @return
*/
String[] value();
/**
* URL(XPath)
* @return URL
*/
String sourceRegion() default "";
}

@ -6,6 +6,7 @@ import java.lang.annotation.Target;
/**
* sourceRegionxpath<br>
*
* @author code4crafter@gmail.com <br>
* @date: 13-8-1 <br>
* Time: 8:40 <br>
@ -14,8 +15,18 @@ import java.lang.annotation.Target;
@Target({ElementType.TYPE})
public @interface TargetUrl {
/**
* URL<br>
* webmagic"."".""\*"".\*""http://\*.oschina.net/\*"oschinaURL<br>
*
* @return
*/
String[] value();
/**
* URL(XPath)
* @return URL
*/
String sourceRegion() default "";
}

@ -12,7 +12,7 @@ import java.io.IOException;
import java.io.PrintWriter;
/**
*
* JSON
*
* @author code4crafter@gmail.com <br>
* Date: 13-4-21

@ -9,6 +9,9 @@ import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
/**
* Pipeline<br>
* 使redis使<br>
*
* @author code4crafter@gmail.com <br>
* @date: 13-8-4 <br>
* Time: 5:15 <br>
@ -34,7 +37,7 @@ public class PagedPipeline implements Pipeline {
if (o instanceof PagedModel) {
PagedModel pagedModel = (PagedModel) o;
pageMap.put(pagedModel.getPageKey(), pagedModel.getPage(), Boolean.TRUE);
if (pagedModel.getOtherPages()!=null){
if (pagedModel.getOtherPages() != null) {
for (String otherPage : pagedModel.getOtherPages()) {
Boolean aBoolean = pageMap.get(pagedModel.getPageKey(), otherPage);
if (aBoolean == null) {
@ -70,8 +73,8 @@ public class PagedPipeline implements Pipeline {
}
});
PagedModel value = entryList.get(0).getValue();
for (int i=1;i<entryList.size();i++){
value=value.combine(entryList.get(i).getValue());
for (int i = 1; i < entryList.size(); i++) {
value = value.combine(entryList.get(i).getValue());
}
objectEntry.setValue(value);
}

Loading…
Cancel
Save