/** * Get the error listener. * @return The registered error listener. */ public ErrorListener getErrorListener() { return XPathContext.this.getErrorListener(); }
/** * Get the error listener. * @return The registered error listener. */ public ErrorListener getErrorListener() { return XPathContext.this.getErrorListener(); }
/** * Construct a simple AVT part. * * @param val A pure string section of an AVT. * @param nsNode An object which can be used to determine the * Namespace Name (URI) for any Namespace prefix used in the XPath. * Usually this is based on the context where the XPath was specified, * such as a node within a Stylesheet. * @param xpathProcessor XPath parser * @param factory XPath factory * @param liaison An XPathContext object, providing infomation specific * to this invocation and this thread. Maintains SAX output state, * variables, error handler and so on, so the transformation/XPath * object itself can be simultaneously invoked from multiple threads. * * @throws javax.xml.transform.TransformerException * TODO: Fix or remove this unused c'tor. */ public AVTPartXPath( String val, org.apache.xml.utils.PrefixResolver nsNode, XPathParser xpathProcessor, XPathFactory factory, XPathContext liaison) throws javax.xml.transform.TransformerException { m_xpath = new XPath(val, null, nsNode, XPath.SELECT, liaison.getErrorListener()); }
/** * Construct a simple AVT part. * * @param val A pure string section of an AVT. * @param nsNode An object which can be used to determine the * Namespace Name (URI) for any Namespace prefix used in the XPath. * Usually this is based on the context where the XPath was specified, * such as a node within a Stylesheet. * @param xpathProcessor XPath parser * @param factory XPath factory * @param liaison An XPathContext object, providing infomation specific * to this invocation and this thread. Maintains SAX output state, * variables, error handler and so on, so the transformation/XPath * object itself can be simultaneously invoked from multiple threads. * * @throws javax.xml.transform.TransformerException * TODO: Fix or remove this unused c'tor. */ public AVTPartXPath( String val, org.apache.xml.utils.PrefixResolver nsNode, XPathParser xpathProcessor, XPathFactory factory, XPathContext liaison) throws javax.xml.transform.TransformerException { m_xpath = new XPath(val, null, nsNode, XPath.SELECT, liaison.getErrorListener()); }
/** * Warn the user of a problem. * * @param xctxt The XPath runtime state. * @param msg Warning message key * @param args Arguments to be used in the warning message * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException */ public void warn(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); TransformerException spe = new TransformerException(formattedMsg, (SourceLocator)xctxt.getSAXLocator()); if (null != errHandler) errHandler.warning(spe); else System.out.println(formattedMsg); }
/** * Tell the user of an error, and probably throw an * exception. * * @param xctxt The XPath runtime state. * @param msg The error message key * @param args Arguments to be used in the error message * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException */ public void error(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createMessage(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); TransformerException spe = new TransformerException(formattedMsg, (SourceLocator)xctxt.getSAXLocator()); if (null != errHandler) errHandler.error(spe); else System.out.println(formattedMsg); }
/** * Warn the user of a problem. * * @param xctxt The XPath runtime state. * @param msg Warning message key * @param args Arguments to be used in the warning message * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException */ public void warn(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); TransformerException spe = new TransformerException(formattedMsg, (SourceLocator)xctxt.getSAXLocator()); if (null != errHandler) errHandler.warning(spe); else System.out.println(formattedMsg); }
/** * Tell the user of an error, and probably throw an * exception. * * @param xctxt The XPath runtime context. * @param msg An error msgkey that corresponds to one of the constants found * in {@link org.apache.xpath.res.XPATHErrorResources}, which is * a key for a format string. * @param args An array of arguments represented in the format string, which * may be null. * * @throws TransformerException if the current ErrorListoner determines to * throw an exception. * * @throws javax.xml.transform.TransformerException */ public void error(XPathContext xctxt, String msg, Object[] args) throws javax.xml.transform.TransformerException { java.lang.String fmsg = XSLMessages.createXPATHMessage(msg, args); if (null != xctxt) { ErrorListener eh = xctxt.getErrorListener(); TransformerException te = new TransformerException(fmsg, this); eh.fatalError(te); } }
/** * Tell the user of an error, and probably throw an * exception. * * @param xctxt The XPath runtime state. * @param msg The error message key * @param args Arguments to be used in the error message * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException */ public void error(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createMessage(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); TransformerException spe = new TransformerException(formattedMsg, (SourceLocator)xctxt.getSAXLocator()); if (null != errHandler) errHandler.error(spe); else System.out.println(formattedMsg); }
/** * Tell the user of an error, and probably throw an * exception. * * @param xctxt The XPath runtime context. * @param msg An error msgkey that corresponds to one of the constants found * in {@link org.apache.xpath.res.XPATHErrorResources}, which is * a key for a format string. * @param args An array of arguments represented in the format string, which * may be null. * * @throws TransformerException if the current ErrorListoner determines to * throw an exception. * * @throws javax.xml.transform.TransformerException */ public void error(XPathContext xctxt, String msg, Object[] args) throws javax.xml.transform.TransformerException { java.lang.String fmsg = XSLMessages.createXPATHMessage(msg, args); if (null != xctxt) { ErrorListener eh = xctxt.getErrorListener(); TransformerException te = new TransformerException(fmsg, this); eh.fatalError(te); } }
/** * Warn the user of a problem. * * @param xctxt The XPath runtime state. * @param msg Warning message key * @param args Arguments to be used in warning message * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException */ public void warn(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); errHandler.warning(new TransformerException(formattedMsg, (SAXSourceLocator)xctxt.getSAXLocator())); }
/** * Warn the user of a problem. * * @param xctxt The XPath runtime state. * @param msg Warning message key * @param args Arguments to be used in warning message * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException */ public void warn(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); errHandler.warning(new TransformerException(formattedMsg, (SAXSourceLocator)xctxt.getSAXLocator())); }
/** * Tell the user of an assertion error, and probably throw an * exception. * * @param b If false, a TransformerException will be thrown. * @param msg The assertion message, which should be informative. * * @throws javax.xml.transform.TransformerException if b is false. */ private void assertion(boolean b, String msg) throws javax.xml.transform.TransformerException { if (!b) { ErrorListener errorHandler = getErrorListener(); if (errorHandler != null) { errorHandler.fatalError( new TransformerException( XSLMessages.createMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ msg }), (SAXSourceLocator)this.getSAXLocator())); } } }
/** * Warn the user of an problem. * * @param xctxt The XPath runtime context. * @param msg An error msgkey that corresponds to one of the conststants found * in {@link org.apache.xpath.res.XPATHErrorResources}, which is * a key for a format string. * @param args An array of arguments represented in the format string, which * may be null. * * @throws TransformerException if the current ErrorListoner determines to * throw an exception. * * @throws javax.xml.transform.TransformerException */ public void warn(XPathContext xctxt, String msg, Object[] args) throws javax.xml.transform.TransformerException { java.lang.String fmsg = XSLMessages.createXPATHWarning(msg, args); if (null != xctxt) { ErrorListener eh = xctxt.getErrorListener(); // TO DO: Need to get stylesheet Locator from here. eh.warning(new TransformerException(fmsg, xctxt.getSAXLocator())); } }
/** * Warn the user of an problem. * * @param xctxt The XPath runtime context. * @param sourceNode Not used. * @param msg An error msgkey that corresponds to one of the constants found * in {@link org.apache.xpath.res.XPATHErrorResources}, which is * a key for a format string. * @param args An array of arguments represented in the format string, which * may be null. * * @throws TransformerException if the current ErrorListoner determines to * throw an exception. */ public void warn( XPathContext xctxt, int sourceNode, String msg, Object[] args) throws javax.xml.transform.TransformerException { String fmsg = XSLMessages.createXPATHWarning(msg, args); ErrorListener ehandler = xctxt.getErrorListener(); if (null != ehandler) { // TO DO: Need to get stylesheet Locator from here. ehandler.warning(new TransformerException(fmsg, (SAXSourceLocator)xctxt.getSAXLocator())); } }
/** * Tell the user of an assertion error, and probably throw an * exception. * * @param b If false, a TransformerException will be thrown. * @param msg The assertion message, which should be informative. * * @throws javax.xml.transform.TransformerException if b is false. */ private void assertion(boolean b, String msg) throws javax.xml.transform.TransformerException { if (!b) { ErrorListener errorHandler = getErrorListener(); if (errorHandler != null) { errorHandler.fatalError( new TransformerException( XSLMessages.createMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ msg }), (SAXSourceLocator)this.getSAXLocator())); } } }
/** * Warn the user of an problem. * * @param xctxt The XPath runtime context. * @param msg An error msgkey that corresponds to one of the conststants found * in {@link org.apache.xpath.res.XPATHErrorResources}, which is * a key for a format string. * @param args An array of arguments represented in the format string, which * may be null. * * @throws TransformerException if the current ErrorListoner determines to * throw an exception. * * @throws javax.xml.transform.TransformerException */ public void warn(XPathContext xctxt, String msg, Object[] args) throws javax.xml.transform.TransformerException { java.lang.String fmsg = XSLMessages.createXPATHWarning(msg, args); if (null != xctxt) { ErrorListener eh = xctxt.getErrorListener(); // TO DO: Need to get stylesheet Locator from here. eh.warning(new TransformerException(fmsg, xctxt.getSAXLocator())); } }
/** * Warn the user of an problem. * * @param xctxt The XPath runtime context. * @param sourceNode Not used. * @param msg An error msgkey that corresponds to one of the constants found * in {@link org.apache.xpath.res.XPATHErrorResources}, which is * a key for a format string. * @param args An array of arguments represented in the format string, which * may be null. * * @throws TransformerException if the current ErrorListoner determines to * throw an exception. */ public void warn( XPathContext xctxt, int sourceNode, String msg, Object[] args) throws javax.xml.transform.TransformerException { String fmsg = XSLMessages.createXPATHWarning(msg, args); ErrorListener ehandler = xctxt.getErrorListener(); if (null != ehandler) { // TO DO: Need to get stylesheet Locator from here. ehandler.warning(new TransformerException(fmsg, (SAXSourceLocator)xctxt.getSAXLocator())); } }
ErrorListener ehandler = xctxt.getErrorListener();
ErrorListener ehandler = xctxt.getErrorListener();