当前位置: 首页>>代码示例>>Java>>正文


Java XPathContext.getErrorListener方法代码示例

本文整理汇总了Java中org.apache.xpath.XPathContext.getErrorListener方法的典型用法代码示例。如果您正苦于以下问题:Java XPathContext.getErrorListener方法的具体用法?Java XPathContext.getErrorListener怎么用?Java XPathContext.getErrorListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.xpath.XPathContext的用法示例。


在下文中一共展示了XPathContext.getErrorListener方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: error

import org.apache.xpath.XPathContext; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:27,代码来源:FuncDocument.java

示例2: warn

import org.apache.xpath.XPathContext; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:26,代码来源:FuncDocument.java

示例3: warn

import org.apache.xpath.XPathContext; //导入方法依赖的package包/类
/**
 * 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()));
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:22,代码来源:FuncFormatNumb.java

示例4: AVTPartXPath

import org.apache.xpath.XPathContext; //导入方法依赖的package包/类
/**
 * 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());
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:27,代码来源:AVTPartXPath.java


注:本文中的org.apache.xpath.XPathContext.getErrorListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。