Default implementation of the Rules interface that supports
the standard rule matching behavior. This class can also be used as a
base class for specialized Rules implementations.
The matching policies implemented by this class support two different types of pattern matching rules:
<c> element, nested inside a <b>
element, which is nested inside an <a> element.<b> element, nested inside an <a>
element, no matter how deeply the pair is nested.| Modifier and Type | Field and Description |
|---|---|
| protected HashMap | cache
The set of registered Rule instances, keyed by the matching pattern. |
| protected Digester | digester
The Digester instance with which this Rules instance is associated. |
| protected ArrayList | rules
The set of registered Rule instances, in the order that they were originally registered. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(String
Nesting pattern to be matched for this Rule pattern, Rule Rule instance to be registered rule)Implements org. Register a new Rule instance matching the specified pattern. |
| public void | clear()
Implements org. Clear all existing Rule instance registrations. |
| public Digester | getDigester()
Implements org. Return the Digester instance with which this Rules instance is associated. |
| protected List | |
| public List | match(String
Namespace URI for which to select matching rules,
or namespaceURI, String null to match regardless of namespace URINesting pattern to be matched pattern)Implements org. Return a List of all registered Rule instances that match the specified nesting pattern, or a zero-length List if there are no matches. |
| public List | rules()
Implements org. Return a List of all registered Rule instances, or a zero-length List if there are no registered Rule instances. |
| public void | setDigester(Digester
The newly associated Digester instance digester)Implements org. Set the Digester instance with which this Rules instance is associated. |
| cache | back to summary |
|---|---|
| protected HashMap<String, List<Rule>> cache The set of registered Rule instances, keyed by the matching pattern. Each value is a List containing the Rules for that pattern, in the order that they were originally registered. | |
| digester | back to summary |
|---|---|
| protected Digester digester The Digester instance with which this Rules instance is associated. | |
| rules | back to summary |
|---|---|
| protected ArrayList<Rule> rules The set of registered Rule instances, in the order that they were originally registered. | |
| RulesBase | back to summary |
|---|---|
| public RulesBase() | |
| add | back to summary |
|---|---|
| public void add(String pattern, Rule rule) Implements org. Register a new Rule instance matching the specified pattern. | |
| clear | back to summary |
|---|---|
| public void clear() Implements org. Clear all existing Rule instance registrations.
| |
| getDigester | back to summary |
|---|---|
| public Digester getDigester() Implements org. Return the Digester instance with which this Rules instance is associated.
| |
| lookup | back to summary |
|---|---|
| protected List Return a List of Rule instances for the specified pattern that also
match the specified namespace URI (if any). If there are no such
rules, return | |
| match | back to summary |
|---|---|
| public List Implements org. Return a List of all registered Rule instances that match the specified
nesting pattern, or a zero-length List if there are no matches. If more
than one Rule instance matches, they must be returned
in the order originally registered through the | |
| rules | back to summary |
|---|---|
| public List Implements org. Return a List of all registered Rule instances, or a zero-length List
if there are no registered Rule instances. If more than one Rule
instance has been registered, they must be returned
in the order originally registered through the
| |
| setDigester | back to summary |
|---|---|
| public void setDigester(Digester digester) Implements org. Set the Digester instance with which this Rules instance is associated. | |