diff --git a/webmagic-avalon/forger/src/main/java/us/codecraft/forger/property/format/Formatter.java b/webmagic-avalon/forger/src/main/java/us/codecraft/forger/property/format/Formatter.java index 45b84b16..4b6475bd 100644 --- a/webmagic-avalon/forger/src/main/java/us/codecraft/forger/property/format/Formatter.java +++ b/webmagic-avalon/forger/src/main/java/us/codecraft/forger/property/format/Formatter.java @@ -22,9 +22,9 @@ public @interface Formatter { String[] value(); /** - * Specific the class of field of class of elements in collection for field.
+ * Specific the class of field of class of elements in collection for field.
* It is not necessary to be set because we can detect the class by class of field, - * unless you use a collection as a field.
+ * unless you use a collection as a field.
* * @return the class of field */ diff --git a/webmagic-core/src/main/java/us/codecraft/webmagic/Site.java b/webmagic-core/src/main/java/us/codecraft/webmagic/Site.java index 85f28546..bc786fc0 100644 --- a/webmagic-core/src/main/java/us/codecraft/webmagic/Site.java +++ b/webmagic-core/src/main/java/us/codecraft/webmagic/Site.java @@ -96,7 +96,7 @@ public class Site { * @param domain domain * @param name name * @param value value - * @return + * @return this */ public Site addCookie(String domain, String name, String value) { cookies.put(domain, name, value); @@ -190,6 +190,7 @@ public class Site { * set timeout for downloader in ms * * @param timeOut timeOut + * @return this */ public Site setTimeOut(int timeOut) { this.timeOut = timeOut; @@ -301,12 +302,12 @@ public class Site { } /** - * Put an Http header for downloader.
- * Use {@link #addCookie(String, String)} for cookie and {@link #setUserAgent(String)} for user-agent.
+ * Put an Http header for downloader.
+ * Use {@link #addCookie(String, String)} for cookie and {@link #setUserAgent(String)} for user-agent.
* * @param key key of http header, there are some keys constant in {@link HeaderConst} * @param value value of header - * @return + * @return this */ public Site addHeader(String key, String value) { headers.put(key, value); @@ -316,6 +317,7 @@ public class Site { /** * Set retry times when download fail, 0 by default.
* + * @param retryTimes retryTimes * @return this */ public Site setRetryTimes(int retryTimes) { @@ -335,6 +337,7 @@ public class Site { /** * Set cycleRetryTimes times when download fail, 0 by default.
* + * @param cycleRetryTimes cycleRetryTimes * @return this */ public Site setCycleRetryTimes(int cycleRetryTimes) { @@ -350,7 +353,7 @@ public class Site { * set up httpProxy for this site * * @param httpProxy httpProxy - * @return + * @return this */ public Site setHttpProxy(HttpHost httpProxy) { this.httpProxy = httpProxy; @@ -369,6 +372,7 @@ public class Site { * Set retry sleep times when download fail, 1000 by default.
* * @param retrySleepTime retrySleepTime + * @return this */ public Site setRetrySleepTime(int retrySleepTime) { this.retrySleepTime = retrySleepTime; @@ -380,7 +384,7 @@ public class Site { * Default is true, you can set it to false to disable gzip. * * @param useGzip useGzip - * @return + * @return this */ public Site setUseGzip(boolean useGzip) { this.useGzip = useGzip; @@ -462,6 +466,7 @@ public class Site { /** * Set httpProxyPool, String[0]:ip, String[1]:port
* + * @param httpProxyList httpProxyList * @return this */ public Site setHttpProxyPool(List httpProxyList) { diff --git a/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java b/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java index d6fc743e..46f56675 100644 --- a/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java +++ b/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java @@ -466,10 +466,10 @@ public class Spider implements Runnable, Task { } /** - * Add urls to crawl.
+ * Add urls to crawl.
* * @param urls urls - * @return + * @return this */ public Spider addUrl(String... urls) { for (String url : urls) { @@ -483,7 +483,7 @@ public class Spider implements Runnable, Task { * Download urls synchronizing. * * @param urls urls - * @return + * @return list downloaded */ public List getAll(Collection urls) { destroyWhenExit = false; @@ -515,7 +515,7 @@ public class Spider implements Runnable, Task { } /** - * Add urls with information to crawl.
+ * Add urls with information to crawl.
* * @param requests requests * @return @@ -582,6 +582,7 @@ public class Spider implements Runnable, Task { /** * start with more than one threads * + * @param executorService executorService to run the spider * @param threadNum threadNum * @return this */ @@ -599,12 +600,12 @@ public class Spider implements Runnable, Task { } /** - * Exit when complete.
- * True: exit when all url of the site is downloaded.
- * False: not exit until call stop() manually.
+ * Exit when complete.
+ * True: exit when all url of the site is downloaded.
+ * False: not exit until call stop() manually.
* * @param exitWhenComplete exitWhenComplete - * @return + * @return this */ public Spider setExitWhenComplete(boolean exitWhenComplete) { this.exitWhenComplete = exitWhenComplete; @@ -680,7 +681,7 @@ public class Spider implements Runnable, Task { * DO NOT set it unless you know what it means! * * @param spawnUrl spawnUrl - * @return + * @return this * @since 0.4.0 */ public Spider setSpawnUrl(boolean spawnUrl) { diff --git a/webmagic-core/src/main/java/us/codecraft/webmagic/processor/PageProcessor.java b/webmagic-core/src/main/java/us/codecraft/webmagic/processor/PageProcessor.java index c21e48ea..1fb125c7 100644 --- a/webmagic-core/src/main/java/us/codecraft/webmagic/processor/PageProcessor.java +++ b/webmagic-core/src/main/java/us/codecraft/webmagic/processor/PageProcessor.java @@ -7,7 +7,7 @@ import us.codecraft.webmagic.Site; * Interface to be implemented to customize a crawler.
*
* In PageProcessor, you can customize: - *

+ *
* start urls and other settings in {@link Site}
* how the urls to fetch are detected
* how the data are extracted and stored
diff --git a/webmagic-core/src/main/java/us/codecraft/webmagic/scheduler/component/DuplicateRemover.java b/webmagic-core/src/main/java/us/codecraft/webmagic/scheduler/component/DuplicateRemover.java index be1ca478..4139f27f 100644 --- a/webmagic-core/src/main/java/us/codecraft/webmagic/scheduler/component/DuplicateRemover.java +++ b/webmagic-core/src/main/java/us/codecraft/webmagic/scheduler/component/DuplicateRemover.java @@ -15,7 +15,7 @@ public interface DuplicateRemover { * * @param request request * @param task task - * @return + * @return true if is duplicate */ public boolean isDuplicate(Request request, Task task); @@ -28,7 +28,7 @@ public interface DuplicateRemover { /** * Get TotalRequestsCount for monitor. * @param task task - * @return + * @return number of total request */ public int getTotalRequestsCount(Task task); diff --git a/webmagic-core/src/main/java/us/codecraft/webmagic/selector/Json.java b/webmagic-core/src/main/java/us/codecraft/webmagic/selector/Json.java index b3945697..bb4b0b84 100644 --- a/webmagic-core/src/main/java/us/codecraft/webmagic/selector/Json.java +++ b/webmagic-core/src/main/java/us/codecraft/webmagic/selector/Json.java @@ -23,7 +23,7 @@ public class Json extends PlainText { /** * remove padding for JSONP * @param padding padding - * @return + * @return json after padding removed */ public Json removePadding(String padding) { String text = getFirstSourceText(); diff --git a/webmagic-core/src/main/java/us/codecraft/webmagic/selector/Selectable.java b/webmagic-core/src/main/java/us/codecraft/webmagic/selector/Selectable.java index 6749d228..9412cfce 100644 --- a/webmagic-core/src/main/java/us/codecraft/webmagic/selector/Selectable.java +++ b/webmagic-core/src/main/java/us/codecraft/webmagic/selector/Selectable.java @@ -124,7 +124,7 @@ public interface Selectable { * extract by JSON Path expression * * @param jsonPath jsonPath - * @return + * @return result */ public Selectable jsonPath(String jsonPath); @@ -132,7 +132,7 @@ public interface Selectable { * extract by custom selector * * @param selector selector - * @return + * @return result */ public Selectable select(Selector selector); @@ -140,13 +140,13 @@ public interface Selectable { * extract by custom selector * * @param selector selector - * @return + * @return result */ public Selectable selectList(Selector selector); /** * get all nodes - * @return + * @return result */ public List nodes(); } diff --git a/webmagic-core/src/main/java/us/codecraft/webmagic/selector/Selectors.java b/webmagic-core/src/main/java/us/codecraft/webmagic/selector/Selectors.java index 6cac9640..96beedbb 100644 --- a/webmagic-core/src/main/java/us/codecraft/webmagic/selector/Selectors.java +++ b/webmagic-core/src/main/java/us/codecraft/webmagic/selector/Selectors.java @@ -35,6 +35,7 @@ public abstract class Selectors { /** * @Deprecated * @see #xpath(String) + * @return new selector */ public static XpathSelector xsoup(String expr) { return new XpathSelector(expr); diff --git a/webmagic-core/src/main/java/us/codecraft/webmagic/utils/UrlUtils.java b/webmagic-core/src/main/java/us/codecraft/webmagic/utils/UrlUtils.java index 14774d00..511dd93b 100644 --- a/webmagic-core/src/main/java/us/codecraft/webmagic/utils/UrlUtils.java +++ b/webmagic-core/src/main/java/us/codecraft/webmagic/utils/UrlUtils.java @@ -22,7 +22,7 @@ public class UrlUtils { /** * canonicalizeUrl - *

+ *
* Borrowed from Jsoup. * * @param url url diff --git a/webmagic-extension/src/main/java/us/codecraft/webmagic/model/annotation/Formatter.java b/webmagic-extension/src/main/java/us/codecraft/webmagic/model/annotation/Formatter.java index a3a56f88..f7edffd5 100644 --- a/webmagic-extension/src/main/java/us/codecraft/webmagic/model/annotation/Formatter.java +++ b/webmagic-extension/src/main/java/us/codecraft/webmagic/model/annotation/Formatter.java @@ -24,9 +24,9 @@ public @interface Formatter { String[] value() default ""; /** - * Specific the class of field of class of elements in collection for field.
+ * Specific the class of field of class of elements in collection for field.
* It is not necessary to be set because we can detect the class by class of field, - * unless you use a collection as a field.
+ * unless you use a collection as a field.
* * @return the class of field */ diff --git a/webmagic-samples/src/test/java/us/codecraft/webmagic/model/ProcessorBenchmark.java b/webmagic-samples/src/test/java/us/codecraft/webmagic/model/ProcessorBenchmark.java index 5513305d..193908de 100644 --- a/webmagic-samples/src/test/java/us/codecraft/webmagic/model/ProcessorBenchmark.java +++ b/webmagic-samples/src/test/java/us/codecraft/webmagic/model/ProcessorBenchmark.java @@ -150,7 +150,7 @@ public class ProcessorBenchmark { "#MyResume textarea {width:170px;height:60px;font-size:9pt;}\n" + "\n" + "

\n" + - "码农一枚
实用主义者
抵制重复造轮子,却造了不少轮子
http://codecraft.us
\n" + + "码农一枚
实用主义者
抵制重复造轮子,却造了不少轮子
http://codecraft.us\n" + "\n" + "