# Class WebRuleSet

java.lang.Object
org.apache.tomcat.util.descriptor.web.WebRuleSet

All Implemented Interfaces:
  `RuleSet`

public class WebRuleSet extends Object implements RuleSet

RuleSet for processing the contents of a web application deployment descriptor (`/WEB-INF/web.xml`) resource.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final org.apache.tomcat.util.descriptor.web.AbsoluteOrderingRule`
  `absoluteOrdering`
  The `AbsoluteOrderingRule` rule used to parse the web.xml
  `protected final boolean`
  `fragment`
  Flag that indicates if this ruleset is for a web-fragment.xml file or for a web.xml file.
  `protected final String`
  `fullPrefix`
  The full pattern matching prefix, including the webapp or web-fragment component, to use for matching elements
  `protected final org.apache.tomcat.util.descriptor.web.SetJspConfig`
  `jspConfig`
  The `SetJspConfig` rule used to parse the web.xml
  `protected final org.apache.tomcat.util.descriptor.web.SetLoginConfig`
  `loginConfig`
  The `SetLoginConfig` rule used to parse the web.xml
  `protected final org.apache.tomcat.util.descriptor.web.NameRule`
  `name`
  The `NameRule` rule used to parse the web.xml
  `protected final String`
  `prefix`
  The matching pattern prefix to use for recognizing our elements.
  `protected final org.apache.tomcat.util.descriptor.web.RelativeOrderingRule`
  `relativeOrdering`
  The `RelativeOrderingRule` rule used to parse the web.xml
  `protected final org.apache.tomcat.util.descriptor.web.SetSessionConfig`
  `sessionConfig`
  The `SetSessionConfig` rule used to parse the web.xml
  `protected static final StringManager`
  `sm`
  The string resources for this package.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WebRuleSet()`
  Construct an instance of this `RuleSet` with the default matching pattern prefix and default fragment setting.
  `WebRuleSet(boolean fragment)`
  Construct an instance of this `RuleSet` with the default matching pattern prefix.
  `WebRuleSet(String prefix, boolean fragment)`
  Construct an instance of this `RuleSet` with the specified matching pattern prefix.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addRuleInstances(Digester digester)`
  Add the set of Rule instances defined in this RuleSet to the specified `Digester` instance, associating them with our namespace URI (if any).
  `protected void`
  `configureInjectionRules(Digester digester, String base)`
  `protected void`
  `configureNamingRules(Digester digester)`
  `void`
  `recycle()`
  Reset counter used for validating the web.xml file.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### sm

    protected static final StringManager sm
    The string resources for this package.

  - ### prefix

    protected final String prefix
    The matching pattern prefix to use for recognizing our elements.

  - ### fullPrefix

    protected final String fullPrefix
    The full pattern matching prefix, including the webapp or web-fragment component, to use for matching elements

  - ### fragment

    protected final boolean fragment
    Flag that indicates if this ruleset is for a web-fragment.xml file or for a web.xml file.

  - ### sessionConfig

    protected final org.apache.tomcat.util.descriptor.web.SetSessionConfig sessionConfig
    The `SetSessionConfig` rule used to parse the web.xml

  - ### loginConfig

    protected final org.apache.tomcat.util.descriptor.web.SetLoginConfig loginConfig
    The `SetLoginConfig` rule used to parse the web.xml

  - ### jspConfig

    protected final org.apache.tomcat.util.descriptor.web.SetJspConfig jspConfig
    The `SetJspConfig` rule used to parse the web.xml

  - ### name

    protected final org.apache.tomcat.util.descriptor.web.NameRule name
    The `NameRule` rule used to parse the web.xml

  - ### absoluteOrdering

    protected final org.apache.tomcat.util.descriptor.web.AbsoluteOrderingRule absoluteOrdering
    The `AbsoluteOrderingRule` rule used to parse the web.xml

  - ### relativeOrdering

    protected final org.apache.tomcat.util.descriptor.web.RelativeOrderingRule relativeOrdering
    The `RelativeOrderingRule` rule used to parse the web.xml

- ## Constructor Details

  - ### WebRuleSet

    public WebRuleSet()
    Construct an instance of this `RuleSet` with the default matching pattern prefix and default fragment setting.

  - ### WebRuleSet

    public WebRuleSet(boolean fragment)
    Construct an instance of this `RuleSet` with the default matching pattern prefix.
    Parameters:
      `fragment` - `true` if this is a web fragment

  - ### WebRuleSet

    public WebRuleSet(String prefix, boolean fragment)
    Construct an instance of this `RuleSet` with the specified matching pattern prefix.
    Parameters:
      `prefix` - Prefix for matching pattern rules (including the trailing slash character)
      `fragment` - `true` if this is a web fragment

- ## Method Details

  - ### addRuleInstances

    public void addRuleInstances(Digester digester)

    Add the set of Rule instances defined in this RuleSet to the specified `Digester` instance, associating them with our namespace URI (if any). This method should only be called by a Digester instance.

    Specified by:
      `addRuleInstances` in interface `RuleSet`
    Parameters:
      `digester` - Digester instance to which the new Rule instances should be added.

  - ### configureNamingRules

    protected void configureNamingRules(Digester digester)

  - ### configureInjectionRules

    protected void configureInjectionRules(Digester digester, String base)

  - ### recycle

    public void recycle()
    Reset counter used for validating the web.xml file.