/** * Request compile-time generation of trace code (or not) * * @param trace true if compile-time generation of trace code is required * @since 9.0 */ public void setCompileWithTracing(boolean trace) { if (trace) { codeInjector = new TraceCodeInjector(); } else { codeInjector = null; } }
/** * Get the associated CodeInjector to be used at compile time to generate the tracing calls */ public CodeInjector getCodeInjector() { return new TraceCodeInjector(); }
/** * Get the associated CodeInjector to be used at compile time to generate the tracing calls */ public CodeInjector getCodeInjector() { return new TraceCodeInjector(); }
/** * Request compile-time generation of trace code (or not) * * @param trace true if compile-time generation of trace code is required * @since 9.0 */ public void setCompileWithTracing(boolean trace) { if (trace) { codeInjector = new TraceCodeInjector(); } else { codeInjector = null; } }
/** * Request compile-time generation of trace code (or not) * * @param trace true if compile-time generation of trace code is required * @since 8.8 */ public void setCompileWithTracing(boolean trace) { internalSetBooleanProperty(Feature.COMPILE_WITH_TRACING, trace); if (defaultXsltCompilerInfo != null) { if (trace) { defaultXsltCompilerInfo.setCodeInjector(new XSLTTraceCodeInjector()); } else { defaultXsltCompilerInfo.setCodeInjector(null); } } if (defaultStaticQueryContext != null) { if (trace) { defaultStaticQueryContext.setCodeInjector(new TraceCodeInjector()); } else { defaultStaticQueryContext.setCodeInjector(null); } } }
/** * Request compile-time generation of trace code (or not) * * @param trace true if compile-time generation of trace code is required * @since 8.8 */ public void setCompileWithTracing(boolean trace) { internalSetBooleanProperty(Feature.COMPILE_WITH_TRACING, trace); if (defaultXsltCompilerInfo != null) { if (trace) { defaultXsltCompilerInfo.setCodeInjector(new XSLTTraceCodeInjector()); } else { defaultXsltCompilerInfo.setCodeInjector(null); } } if (defaultStaticQueryContext != null) { if (trace) { defaultStaticQueryContext.setCodeInjector(new TraceCodeInjector()); } else { defaultStaticQueryContext.setCodeInjector(null); } } }
/** * Prepare an XQuery query for subsequent evaluation. The source text of the query * is supplied as a String. The base URI of the query is taken from the static context, * and defaults to the current working directory. * <p>Note that this interface makes the caller responsible for decoding the query and * presenting it as a string of characters. This means it is likely that any encoding * specified in the query prolog will be ignored.</p> * * @param query The XQuery query to be evaluated, supplied as a string. * @return an XQueryExpression object representing the prepared expression * @throws net.sf.saxon.trans.XPathException * if the syntax of the expression is wrong, * or if it references namespaces, variables, or functions that have not been declared, * or contains other static errors. * @since 8.4 */ /*@NotNull*/ public XQueryExpression compileQuery(/*@NotNull*/ String query) throws XPathException { XQueryParser qp = (XQueryParser) config.newExpressionParser("XQ", isUpdating, 31); if (codeInjector != null) { qp.setCodeInjector(codeInjector); } else if (config.isCompileWithTracing()) { qp.setCodeInjector(new TraceCodeInjector()); } qp.setStreaming(isStreaming()); QueryModule mainModule = new QueryModule(this); return qp.makeXQueryExpression(query, mainModule, config); }
/** * Prepare an XQuery query for subsequent evaluation. The source text of the query * is supplied as a String. The base URI of the query is taken from the static context, * and defaults to the current working directory. * <p>Note that this interface makes the caller responsible for decoding the query and * presenting it as a string of characters. This means it is likely that any encoding * specified in the query prolog will be ignored.</p> * * @param query The XQuery query to be evaluated, supplied as a string. * @return an XQueryExpression object representing the prepared expression * @throws net.sf.saxon.trans.XPathException * if the syntax of the expression is wrong, * or if it references namespaces, variables, or functions that have not been declared, * or contains other static errors. * @since 8.4 */ /*@NotNull*/ public XQueryExpression compileQuery(/*@NotNull*/ String query) throws XPathException { XQueryParser qp = (XQueryParser) config.newExpressionParser("XQ", isUpdating, 31); if (codeInjector != null) { qp.setCodeInjector(codeInjector); } else if (config.isCompileWithTracing()) { qp.setCodeInjector(new TraceCodeInjector()); } qp.setStreaming(isStreaming()); QueryModule mainModule = new QueryModule(this); return qp.makeXQueryExpression(query, mainModule, config); }
qp.setCodeInjector(importer.getCodeInjector()); } else if (config.isCompileWithTracing()) { qp.setCodeInjector(new TraceCodeInjector());
qp.setCodeInjector(importer.getCodeInjector()); } else if (config.isCompileWithTracing()) { qp.setCodeInjector(new TraceCodeInjector());