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

Method lookup

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

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 . @param namespaceURI Namespace URI to match, or null to select matching rules regardless of namespace

(String namespaceURI, String pattern)

Source from the content-addressed store, hash-verified

183 * @return a rules list
184 */
185 protected List<Rule> lookup(String namespaceURI, String pattern) {
186 // Optimize when no namespace URI is specified
187 List<Rule> list = this.cache.get(pattern);
188 if (list == null) {
189 return null;
190 }
191 if (namespaceURI == null || namespaceURI.isEmpty()) {
192 return list;
193 }
194
195 // Select only Rules that match on the specified namespace URI
196 List<Rule> results = new ArrayList<>();
197 for (Rule item : list) {
198 if ((namespaceURI.equals(item.getNamespaceURI())) || (item.getNamespaceURI() == null)) {
199 results.add(item);
200 }
201 }
202 return results;
203 }
204}

Callers 1

matchMethod · 0.95

Calls 5

getNamespaceURIMethod · 0.80
getMethod · 0.65
equalsMethod · 0.65
addMethod · 0.65
isEmptyMethod · 0.45

Tested by

no test coverage detected