use of javax.xml.transform.ErrorListener in project j2objc by google.
the class MsgMgr method error.
/**
* Tell the user of an error, and probably throw an
* exception.
*
* @param styleNode Stylesheet node
* @param sourceNode Source tree node
* @param msg Message text to issue
* @param args Arguments to use in message
* @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
* the error condition is severe enough to halt processing.
*
* @throws TransformerException
* @xsl.usage internal
*/
public void error(SourceLocator srcLctr, Node styleNode, Node sourceNode, String msg, Object[] args) throws TransformerException {
String formattedMsg = XSLMessages.createMessage(msg, args);
// Locator locator = m_stylesheetLocatorStack.isEmpty()
// ? null :
// ((Locator)m_stylesheetLocatorStack.peek());
// Locator locator = null;
ErrorListener errHandler = m_transformer.getErrorListener();
if (null != errHandler)
errHandler.fatalError(new TransformerException(formattedMsg, srcLctr));
else
throw new TransformerException(formattedMsg, srcLctr);
}
use of javax.xml.transform.ErrorListener in project j2objc by google.
the class MsgMgr method error.
/**
* Tell the user of an error, and probably throw an
* exception.
*
* @param msg Message text to issue
* @param args Arguments to use in message
* @param e Exception to throw
* @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
* the error condition is severe enough to halt processing.
*
* @throws TransformerException
* @xsl.usage internal
*/
public void error(SourceLocator srcLctr, String msg, Object[] args, Exception e) throws TransformerException {
//msg = (null == msg) ? XSLTErrorResources.ER_PROCESSOR_ERROR : msg;
String formattedMsg = XSLMessages.createMessage(msg, args);
// Locator locator = m_stylesheetLocatorStack.isEmpty()
// ? null :
// ((Locator)m_stylesheetLocatorStack.peek());
// Locator locator = null;
ErrorListener errHandler = m_transformer.getErrorListener();
if (null != errHandler)
errHandler.fatalError(new TransformerException(formattedMsg, srcLctr));
else
throw new TransformerException(formattedMsg, srcLctr);
}
use of javax.xml.transform.ErrorListener in project j2objc by google.
the class MsgMgr method warn.
/**
* Warn the user of a problem.
*
* @param styleNode Stylesheet node
* @param sourceNode Source tree node
* @param msg Message text to issue
* @param args Arguments to pass to the message
* @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
* the error condition is severe enough to halt processing.
*
* @throws TransformerException
* @xsl.usage internal
*/
public void warn(SourceLocator srcLctr, Node styleNode, Node sourceNode, String msg, Object[] args) throws TransformerException {
String formattedMsg = XSLMessages.createWarning(msg, args);
ErrorListener errHandler = m_transformer.getErrorListener();
if (null != errHandler)
errHandler.warning(new TransformerException(formattedMsg, srcLctr));
else
System.out.println(formattedMsg);
}
use of javax.xml.transform.ErrorListener in project robovm by robovm.
the class MsgMgr method error.
/**
* Tell the user of an error, and probably throw an
* exception.
*
* @param msg Message text to issue
* @param args Arguments to use in message
* @param e Exception to throw
* @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
* the error condition is severe enough to halt processing.
*
* @throws TransformerException
* @xsl.usage internal
*/
public void error(SourceLocator srcLctr, String msg, Object[] args, Exception e) throws TransformerException {
//msg = (null == msg) ? XSLTErrorResources.ER_PROCESSOR_ERROR : msg;
String formattedMsg = XSLMessages.createMessage(msg, args);
// Locator locator = m_stylesheetLocatorStack.isEmpty()
// ? null :
// ((Locator)m_stylesheetLocatorStack.peek());
// Locator locator = null;
ErrorListener errHandler = m_transformer.getErrorListener();
if (null != errHandler)
errHandler.fatalError(new TransformerException(formattedMsg, srcLctr));
else
throw new TransformerException(formattedMsg, srcLctr);
}
use of javax.xml.transform.ErrorListener in project robovm by robovm.
the class FuncDocument method warn.
/**
* 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);
}
Aggregations