Top Description Fields Constructors Methods
org.apache.tomcat.util.digester

public Class RulesBase

extends Object
implements Rules
Class Inheritance
All Implemented Interfaces
org.apache.tomcat.util.digester.Rules
Imports
java.util.ArrayList, .HashMap, .List

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:

Field Summary

Modifier and TypeField and Description
protected HashMap<String, List<Rule>>
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<Rule>
rules

The set of registered Rule instances, in the order that they were originally registered.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(String
Nesting pattern to be matched for this Rule
pattern
,
Rule
Rule instance to be registered
rule
)

Implements org.apache.tomcat.util.digester.Rules.add.

Register a new Rule instance matching the specified pattern.

public void
clear()

Implements org.apache.tomcat.util.digester.Rules.clear.

Clear all existing Rule instance registrations.

public Digester
getDigester()

Implements org.apache.tomcat.util.digester.Rules.getDigester.

Return the Digester instance with which this Rules instance is associated.

protected List<Rule>

Returns:

a rules list
lookup
(String
Namespace URI to match, or null to select matching rules regardless of namespace URI
namespaceURI
,
String
Pattern to be matched
pattern
)

Return a List of Rule instances for the specified pattern that also match the specified namespace URI (if any).

public List<Rule>
match(String
Namespace URI for which to select matching rules, or null to match regardless of namespace URI
namespaceURI
,
String
Nesting pattern to be matched
pattern
)

Implements org.apache.tomcat.util.digester.Rules.match.

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<Rule>
rules()

Implements org.apache.tomcat.util.digester.Rules.rules.

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.apache.tomcat.util.digester.Rules.setDigester.

Set the Digester instance with which this Rules instance is associated.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheback 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.

digesterback to summary
protected Digester digester

The Digester instance with which this Rules instance is associated.

rulesback to summary
protected ArrayList<Rule> rules

The set of registered Rule instances, in the order that they were originally registered.

Constructor Detail

RulesBaseback to summary
public RulesBase()

Method Detail

addback to summary
public void add(String pattern, Rule rule)

Implements org.apache.tomcat.util.digester.Rules.add.

Register a new Rule instance matching the specified pattern.

Parameters
pattern:String

Nesting pattern to be matched for this Rule

rule:Rule

Rule instance to be registered

Annotations
@Override
clearback to summary
public void clear()

Implements org.apache.tomcat.util.digester.Rules.clear.

Clear all existing Rule instance registrations.

Annotations
@Override
getDigesterback to summary
public Digester getDigester()

Implements org.apache.tomcat.util.digester.Rules.getDigester.

Return the Digester instance with which this Rules instance is associated.

Returns:Digester

Doc from org.apache.tomcat.util.digester.Rules.getDigester.

the Digester instance with which this Rules instance is associated.

Annotations
@Override
lookupback to summary
protected List<Rule> lookup(String namespaceURI, String pattern)

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 null.

Parameters
namespaceURI:String

Namespace URI to match, or null to select matching rules regardless of namespace URI

pattern:String

Pattern to be matched

Returns:List<Rule>

a rules list

matchback to summary
public List<Rule> match(String namespaceURI, String pattern)

Implements org.apache.tomcat.util.digester.Rules.match.

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 add() method.

Parameters
namespaceURI:String

Namespace URI for which to select matching rules, or null to match regardless of namespace URI

pattern:String

Nesting pattern to be matched

Returns:List<Rule>

Doc from org.apache.tomcat.util.digester.Rules.match.

a rules list

Annotations
@Override
rulesback to summary
public List<Rule> rules()

Implements org.apache.tomcat.util.digester.Rules.rules.

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 add() method.

Returns:List<Rule>

Doc from org.apache.tomcat.util.digester.Rules.rules.

a rules list

Annotations
@Override
setDigesterback to summary
public void setDigester(Digester digester)

Implements org.apache.tomcat.util.digester.Rules.setDigester.

Set the Digester instance with which this Rules instance is associated.

Parameters
digester:Digester

The newly associated Digester instance

Annotations
@Override