MCPcopy Create free account
hub / github.com/apache/tomcat / add

Method add

java/org/apache/tomcat/util/digester/RulesBase.java:100–113  ·  view source on GitHub ↗

Register a new Rule instance matching the specified pattern. @param pattern Nesting pattern to be matched for this Rule @param rule Rule instance to be registered

(String pattern, Rule rule)

Source from the content-addressed store, hash-verified

98 * @param rule Rule instance to be registered
99 */
100 @Override
101 public void add(String pattern, Rule rule) {
102 // to help users who accidentally add '/' to the end of their patterns
103 int patternLength = pattern.length();
104 if (patternLength > 1 && pattern.endsWith("/")) {
105 pattern = pattern.substring(0, patternLength - 1);
106 }
107
108 cache.computeIfAbsent(pattern, k -> new ArrayList<>()).add(rule);
109 rules.add(rule);
110 if (this.digester != null) {
111 rule.setDigester(this.digester);
112 }
113 }
114
115
116 /**

Callers

nothing calls this directly

Calls 4

lengthMethod · 0.80
endsWithMethod · 0.80
addMethod · 0.65
setDigesterMethod · 0.65

Tested by

no test coverage detected