src.server
Class ModuleQueryRule

java.lang.Object
  extended bysrc.server.QueryRule
      extended bysrc.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 src.server.QueryRule
matches, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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.
Method Detail

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.