/** * Get the ErrorListener in use for this static context * @return the registered ErrorListener */ public ErrorListener getErrorListener() { if (errorListener == null) { errorListener = config.getErrorListener(); } return errorListener; }
/** * Get the ErrorListener in use for this static context * * @return the registered ErrorListener */ public UnfailingErrorListener getErrorListener() { if (errorListener == null) { errorListener = config.getErrorListener(); } return errorListener; }
/** * Get the error listener. If no ErrorListener * has been set locally, the ErrorListener in the Controller is returned; this in turn defaults * to the ErrorListener set in the Configuration. * * @return the ErrorListener in use. This will always be an UnfailingErrorListener, * which is a Saxon subclass of ErrorListener that throws no exceptions. * @since 9.6 */ public UnfailingErrorListener getErrorListener() { return config.getErrorListener(); }
/** * Get the error listener. If no ErrorListener * has been set locally, the ErrorListener in the Controller is returned; this in turn defaults * to the ErrorListener set in the Configuration. * * @return the ErrorListener in use. This will always be an UnfailingErrorListener, * which is a Saxon subclass of ErrorListener that throws no exceptions. * @since 9.6 */ public UnfailingErrorListener getErrorListener() { return config.getErrorListener(); }
/** * Load a schema, which will be available for use by all subsequent operations using * this Configuration. Any errors will be notified to the ErrorListener associated with * this Configuration. * @param schemaSource the JAXP Source object identifying the schema document to be loaded * @throws SchemaException if the schema cannot be read or parsed or if it is invalid * @throws UnsupportedOperationException if the configuration is not schema-aware * @since 8.4 */ public void addSchemaSource(Source schemaSource) throws SchemaException { addSchemaSource(schemaSource, getErrorListener()); }
/** * Load a schema, which will be available for use by all subsequent operations using * this Configuration. Any errors will be notified to the ErrorListener associated with * this Configuration. * * @param schemaSource the JAXP Source object identifying the schema document to be loaded * @throws SchemaException if the schema cannot be read or parsed or if it is invalid * @throws UnsupportedOperationException if the configuration is not schema-aware * @since 8.4 */ public void addSchemaSource(Source schemaSource) throws SchemaException { addSchemaSource(schemaSource, getErrorListener()); }
/** * Get the default options for XSLT compilation * * @return the default options for XSLT compilation. The CompilerInfo object will reflect any options * set using other methods available for this Configuration object */ public CompilerInfo getDefaultXsltCompilerInfo() { if (defaultXsltCompilerInfo.getErrorListener() == null) { defaultXsltCompilerInfo.setErrorListener(getErrorListener()); } return defaultXsltCompilerInfo; }
/** * Get the error event handler for the TransformerFactory. * * @return The current error listener, which should never be null. */ public ErrorListener getErrorListener() { UnfailingErrorListener uel = getConfiguration().getErrorListener(); if (uel instanceof DelegatingErrorListener) { return ((DelegatingErrorListener) uel).getBaseErrorListener(); } else { return uel; } }
private static void explain(Configuration config, String message, int flags) { try { if ((flags & WARNING_IF_FALSE) != 0) { config.getErrorListener().warning(new XPathException("deep-equal(): " + message)); } } catch (TransformerException e) { // } }
/** * Report a fatal error * * @param err the exception to be reported */ public void reportFatalError(XPathException err) { if (!err.hasBeenReported()) { getErrorListener().fatalError(err); err.setHasBeenReported(true); } }
/** * Import a schema. This is possible only if the schema-aware version of Saxon is being used, * and if the Configuration is a SchemaAwareConfiguration. Having imported a schema, the types * defined in that schema become part of the static context. * @param source A Source object identifying the schema document to be loaded * @throws net.sf.saxon.type.SchemaException if the schema contained in this document is invalid * @throws UnsupportedOperationException if the configuration is not schema-aware */ public void importSchema(Source source) throws SchemaException { getConfiguration().addSchemaSource(source, getConfiguration().getErrorListener()); }
/** * Report a fatal error * * @param err the exception to be reported */ public void reportFatalError(XPathException err) { if (!err.hasBeenReported()) { getErrorListener().fatalError(err); err.setHasBeenReported(true); } }
protected void reportFatalError(XPathException err) { try { if (errorListener != null) { errorListener.error(err); } else { getConfiguration().getErrorListener().error(err); } } catch (TransformerException e) { // no action if error reporting fails } }
/** * Issue a compile-time warning. This method is used during XPath expression compilation to * output warning conditions. The default implementation writes the message to the * error listener registered with the Configuration. */ public void issueWarning(String s, Location locator) { XPathException ex = new XPathException(s); ex.setLocation(locator); config.getErrorListener().warning(ex); }
/** * Issue a compile-time warning. This method is used during XPath expression compilation to * output warning conditions. The default implementation writes the message to the * error listener registered with the Configuration. */ public void issueWarning(String s, Location locator) { XPathException ex = new XPathException(s); ex.setLocation(locator); config.getErrorListener().warning(ex); }
private static void explain(Configuration config, String message, int flags, NodeInfo n1, NodeInfo n2) { if ((flags & WARNING_IF_FALSE) != 0) { config.getErrorListener().warning(new XPathException("deep-equal() " + (n1 != null && n2 != null ? "comparing " + Navigator.getPath(n1) + " to " + Navigator.getPath(n2) + ": " : ": ") + message)); } }
/** * Issue a compile-time warning */ public void issueWarning(String s, Location locator) { XPathException err = new XPathException(s); err.setLocator(locator); getConfiguration().getErrorListener().warning(err); }
private static void explain(Configuration config, String message, int flags, NodeInfo n1, NodeInfo n2) { if ((flags & WARNING_IF_FALSE) != 0) { config.getErrorListener().warning(new XPathException("deep-equal() " + (n1 != null && n2 != null ? "comparing " + Navigator.getPath(n1) + " to " + Navigator.getPath(n2) + ": " : ": ") + message)); } }
/** * Make a PipelineConfiguration from the properties of this Configuration * * @return a new PipelineConfiguration * @since 8.4 */ public PipelineConfiguration makePipelineConfiguration() { PipelineConfiguration pipe = new PipelineConfiguration(this); pipe.setURIResolver(getURIResolver()); pipe.setParseOptions(new ParseOptions(defaultParseOptions)); pipe.setErrorListener(getErrorListener()); return pipe; }
/** * Protected constructor * @param processor the Saxon processor */ protected XsltCompiler(Processor processor) { this.processor = processor; this.config = processor.getUnderlyingConfiguration(); compilerInfo = new CompilerInfo(); compilerInfo.setURIResolver(config.getURIResolver()); compilerInfo.setErrorListener(config.getErrorListener()); compilerInfo.setCompileWithTracing(config.isCompileWithTracing()); }