/** * This method is called when the body of a matching XML element is * encountered. If the element has no body, this method is * called with an empty string as the body text. * <p> * The default implementation delegates to the deprecated method * {@link #body(String) body} without the <code>namespace</code> and * <code>name</code> parameters, to retain backwards compatibility. * * @param namespace the namespace URI of the matching element, or an * empty string if the parser is not namespace aware or the element has * no namespace * @param name the local name if the parser is namespace aware, or just * the element name otherwise * @param text The text of the body of this element * @since Digester 1.4 */ public void body(String namespace, String name, String text) throws Exception { body(text); }
/** * Duplicate the processing that the Digester does when firing the * body methods of rules. It would be really nice if the Digester * class provided a way for this functionality to just be invoked * directly. */ private void fireBodyMethods(List<Rule> rules, String namespaceURI, String name, String text) throws Exception { if ((rules != null) && (rules.size() > 0)) { Log log = digester.getLogger(); boolean debug = log.isDebugEnabled(); for (int i = 0; i < rules.size(); i++) { try { Rule rule = rules.get(i); if (debug) { log.debug(" Fire body() for " + rule); } rule.body(namespaceURI, name, text); } catch (Exception e) { throw digester.createSAXException(e); } catch (Error e) { throw e; } } } }
log.debug(" Fire body() for " + rule); rule.body(namespaceURI, name, bodyText); } catch (Exception e) { log.error("Body event threw exception", e);
/** * 匹配主体部分. * * @param namespace 名字空间 * @param name XML元素local名 * @param text XML元素值 * @throws Exception 如果失败 */ @Override public void body(String namespace, String name, String text) throws Exception { rule.body(namespace, name, text); }
/** * This method is called when the body of a matching XML element is * encountered. If the element has no body, this method is * called with an empty string as the body text. * <p> * The default implementation delegates to the deprecated method * {@link #body(String) body} without the <code>namespace</code> and * <code>name</code> parameters, to retain backwards compatibility. * * @param namespace the namespace URI of the matching element, or an * empty string if the parser is not namespace aware or the element has * no namespace * @param name the local name if the parser is namespace aware, or just * the element name otherwise * @param text The text of the body of this element * @since Digester 1.4 */ public void body(String namespace, String name, String text) throws Exception { body(text); }
/** * Duplicate the processing that the Digester does when firing the * body methods of rules. It would be really nice if the Digester * class provided a way for this functionality to just be invoked * directly. */ private void fireBodyMethods(List<Rule> rules, String namespaceURI, String name, String text) throws Exception { if ((rules != null) && (rules.size() > 0)) { Log log = digester.getLogger(); boolean debug = log.isDebugEnabled(); for (int i = 0; i < rules.size(); i++) { try { Rule rule = (Rule) rules.get(i); if (debug) { log.debug(" Fire body() for " + rule); } rule.body(namespaceURI, name, text); } catch (Exception e) { throw digester.createSAXException(e); } catch (Error e) { throw e; } } } }
log.debug(" Fire body() for " + rule); rule.body(namespaceURI, name, bodyText); } catch (Exception e) { log.error("Body event threw exception", e);