net.sf.jabb.util.text
Class MatchingDefinition
java.lang.Object
net.sf.jabb.util.text.MatchingDefinition
public class MatchingDefinition
- extends Object
Definition of how the matching will should be done.
匹配方式定义。
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.
Only one of exactMatchExamples and exactMatchExample
need to be not null.
它由三项数据组成:
regularExpression: 用作匹配的正则表达式。
exactMatchExamples: 能够刚好匹配此正则表达式的一组示范字符串。
这些字符串被用来“训练”匹配引擎,所以它们需要能覆盖全部的匹配状态。
exactMatchExample: 能够刚好匹配此正则表达式的一个示范字符串。
这个字符串被用来“训练”匹配引擎, 所以它需要能覆盖全部的匹配状态。
attachment: 与此匹配条件相关联的一个附件,可以是任意对象。
如果匹配,它会被作为匹配的结果返回。
exactMatchExamples和exactMatchExample只需要有一个为非null。
- Author:
- Zhengmao HU (James)
MatchingDefinition
public MatchingDefinition()
toString
public String toString()
- Overrides:
toString in class Object
getRegularExpression
public String getRegularExpression()
setRegularExpression
public void setRegularExpression(String regularExpression)
getExactMatchExamples
public List<String> getExactMatchExamples()
setExactMatchExamples
public void setExactMatchExamples(List<String> exactExample)
getExactMatchExample
public String getExactMatchExample()
setExactMatchExample
public void setExactMatchExample(String exactMatchExample)
getAttachment
public Object getAttachment()
setAttachment
public void setAttachment(Object attachment)
Copyright © 2012. All Rights Reserved.