public class MatchingDefinition extends Object
It consists of three parts:
regularExpression
: The regular expression used for matching.exactMatchExamples
: A list of example strings that could and
only could match the regular expression. These example strings will
be used to exercise the matching engine, so they should cover all the
possibilities of matching.exactMatchExample
: An example string that could and only could
match the regular expression. The example string will be used to exercise the
matching engine, so it should cover all the possibilities of matching.attachment
: An attachment object that should be associated
with this matching. If matched, this object will be returned.exactMatchExamples
and exactMatchExample
need to be not null.
它由三项数据组成:
regularExpression
: 用作匹配的正则表达式。exactMatchExamples
: 能够刚好匹配此正则表达式的一组示范字符串。
这些字符串被用来“训练”匹配引擎,所以它们需要能覆盖全部的匹配状态。exactMatchExample
: 能够刚好匹配此正则表达式的一个示范字符串。
这个字符串被用来“训练”匹配引擎, 所以它需要能覆盖全部的匹配状态。attachment
: 与此匹配条件相关联的一个附件,可以是任意对象。
如果匹配,它会被作为匹配的结果返回。exactMatchExamples
和exactMatchExample
只需要有一个为非null。Constructor and Description |
---|
MatchingDefinition() |
Modifier and Type | Method and Description |
---|---|
Object |
getAttachment() |
String |
getExactMatchExample() |
List<String> |
getExactMatchExamples() |
String |
getRegularExpression() |
static List<MatchingDefinition> |
load(Map<? extends Object,? extends Object> props)
Loads definitions from properties.
|
void |
setAttachment(Object attachment) |
void |
setExactMatchExample(String exactMatchExample) |
void |
setExactMatchExamples(List<String> exactExample) |
void |
setRegularExpression(String regularExpression) |
String |
toString() |
public static List<MatchingDefinition> load(Map<? extends Object,? extends Object> props)
props
- public String getRegularExpression()
public void setRegularExpression(String regularExpression)
public String getExactMatchExample()
public void setExactMatchExample(String exactMatchExample)
public Object getAttachment()
public void setAttachment(Object attachment)
Copyright © 2014. All Rights Reserved.