git://wamblee.org
/
utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
checkstyleZZ
[utils]
/
crawler
/
basic
/
src
/
org
/
wamblee
/
crawler
/
impl
/
ConfigItem.java
diff --git
a/crawler/basic/src/org/wamblee/crawler/impl/ConfigItem.java
b/crawler/basic/src/org/wamblee/crawler/impl/ConfigItem.java
index d6c73859469a8d86fc235005a460557eb9007e62..6349d2c1b77fbe96c43ae541725369822b2bf9f1 100644
(file)
--- a/
crawler/basic/src/org/wamblee/crawler/impl/ConfigItem.java
+++ b/
crawler/basic/src/org/wamblee/crawler/impl/ConfigItem.java
@@
-19,7
+19,7
@@
package org.wamblee.crawler.impl;
import java.util.regex.Pattern;
/**
import java.util.regex.Pattern;
/**
- *
+ *
Configuration item for obtaining an object in case a pattern matches.
*/
class ConfigItem<ValueType> {
*/
class ConfigItem<ValueType> {
@@
-27,11
+27,21
@@
class ConfigItem<ValueType> {
private ValueType _value;
private ValueType _value;
+ /**
+ * Constructs the item.
+ * @param aPattern Pattern.
+ * @param aValue Value.
+ */
protected ConfigItem(String aPattern, ValueType aValue) {
_pattern = Pattern.compile(aPattern);
_value = aValue;
}
protected ConfigItem(String aPattern, ValueType aValue) {
_pattern = Pattern.compile(aPattern);
_value = aValue;
}
+ /**
+ * Returns the object in case the value matches.
+ * @param aValue Value to match.
+ * @return Object in case there is a match, null otherwise.
+ */
protected ValueType match(String aValue) {
if (!_pattern.matcher(aValue).matches()) {
return null;
protected ValueType match(String aValue) {
if (!_pattern.matcher(aValue).matches()) {
return null;