MCPcopy Index your code
hub / github.com/apache/tomcat / startElement

Method startElement

java/org/apache/tomcat/util/digester/Digester.java:1313–1376  ·  view source on GitHub ↗

Process notification of the start of an XML element being reached. @param namespaceURI The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. @param localName The local name (without prefix), or the em

(String namespaceURI, String localName, String qName, Attributes list)

Source from the content-addressed store, hash-verified

1311 * @exception SAXException if a parsing error is to be reported
1312 */
1313 @Override
1314 public void startElement(String namespaceURI, String localName, String qName, Attributes list) throws SAXException {
1315 boolean debug = log.isTraceEnabled();
1316
1317 if (saxLog.isTraceEnabled()) {
1318 saxLog.trace("startElement(" + namespaceURI + "," + localName + "," + qName + ")");
1319 }
1320
1321 // Parse system properties
1322 list = updateAttributes(list);
1323
1324 // Save the body text accumulated for our surrounding element
1325 bodyTexts.push(bodyText);
1326 bodyText = new StringBuilder();
1327
1328 // the actual element name is either in localName or qName, depending
1329 // on whether the parser is namespace aware
1330 String name = localName;
1331 if ((name == null) || (name.isEmpty())) {
1332 name = qName;
1333 }
1334
1335 // Compute the current matching rule
1336 StringBuilder sb = new StringBuilder(match);
1337 if (!match.isEmpty()) {
1338 sb.append('/');
1339 }
1340 sb.append(name);
1341 match = sb.toString();
1342 if (debug) {
1343 log.trace(" New match='" + match + "'");
1344 }
1345
1346 // Fire "begin" events for all relevant rules
1347 List<Rule> rules = getRules().match(namespaceURI, match);
1348 matches.push(rules);
1349 if ((rules != null) && (!rules.isEmpty())) {
1350 for (Rule rule : rules) {
1351 try {
1352 if (debug) {
1353 log.trace(" Fire begin() for " + rule);
1354 }
1355 rule.begin(namespaceURI, name, list);
1356 } catch (ClassNotFoundException cnfe) {
1357 log.error(sm.getString("digester.error.begin"), cnfe);
1358 if (log.isDebugEnabled()) {
1359 log.debug(ToStringUtil.classPathForCNFE(getClassLoader()));
1360 }
1361 throw createSAXException(cnfe);
1362 } catch (Exception e) {
1363 log.error(sm.getString("digester.error.begin"), e);
1364 throw createSAXException(e);
1365 } catch (Error e) {
1366 log.error(sm.getString("digester.error.begin"), e);
1367 throw e;
1368 }
1369 }
1370 } else {

Callers

nothing calls this directly

Calls 15

updateAttributesMethod · 0.95
getRulesMethod · 0.95
classPathForCNFEMethod · 0.95
getClassLoaderMethod · 0.95
createSAXExceptionMethod · 0.95
isTraceEnabledMethod · 0.65
traceMethod · 0.65
pushMethod · 0.65
toStringMethod · 0.65
matchMethod · 0.65
beginMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected