src.server
Class ModuleQueryRule
java.lang.Object
src.server.QueryRule
src.server.ModuleQueryRule
- public class ModuleQueryRule
- extends QueryRule
A QueryRule that describes rules used by modules.
- Version:
- 2005-apr-27
|
Constructor Summary |
ModuleQueryRule(java.lang.String regexpPattern,
java.lang.String ruleName,
java.lang.String[] keys,
java.lang.String moduleName)
Constructor for ModuleQueryRule. |
|
Method Summary |
java.lang.String |
getOwnerModule()
Gets the module that "owns" the rule. |
java.util.HashMap |
getResult(java.lang.String query)
Gets a query formatted according to the rule's settings. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ModuleQueryRule
public ModuleQueryRule(java.lang.String regexpPattern,
java.lang.String ruleName,
java.lang.String[] keys,
java.lang.String moduleName)
- Constructor for ModuleQueryRule.
- Parameters:
regexpPattern - The regexp pattern which descibes what queries
that should match the rule.ruleName - The name of the rule.keys - The keys that should be used for the corresponding extracted
groups in the result map.moduleName - The module that provides the rule, preferebly the same
name as Processor uses for the module.
getOwnerModule
public java.lang.String getOwnerModule()
- Gets the module that "owns" the rule. I.e. the module that the rule is
connected to.
- Returns:
- A module name.
getResult
public java.util.HashMap getResult(java.lang.String query)
- Gets a query formatted according to the rule's settings. The query
should match (checked with matches()) before calling this method.
- Overrides:
getResult in class QueryRule
- Parameters:
query - The query to format.
- Returns:
- A map containing the rules name as "regexp" and the extracted
groups as the keys specified at construction time.