/** * This method creates a copy of a FunctionLibrary: if the original FunctionLibrary allows * new functions to be added, then additions to this copy will not affect the original, or * vice versa. * * @return a copy of this function library. This must be an instance of the original class. */ public FunctionLibrary copy() { UnboundFunctionLibrary qfl = new UnboundFunctionLibrary(); qfl.unboundFunctionCalls = new ArrayList(unboundFunctionCalls); qfl.correspondingStaticContext = new ArrayList(correspondingStaticContext); return qfl; }
/** * Bind function calls that could not be bound when first encountered. These * will either be forwards references to functions declared later in the same query module, * or in modules that are being imported recursively, or errors. * <p>This method is for internal use only.</p> * * @throws net.sf.saxon.trans.XPathException * if a function call refers to a function that has * not been declared */ public void bindUnboundFunctionCalls() throws XPathException { UnboundFunctionLibrary lib = (UnboundFunctionLibrary) functionLibraryList.get(unboundFunctionLibraryNr); lib.bindUnboundFunctionReferences(functionLibraryList, getConfiguration()); }
/** * Bind function calls that could not be bound when first encountered. These * will either be forwards references to functions declared later in the same query module, * or in modules that are being imported recursively, or errors. * <p/> * This method is for internal use only. * * @throws net.sf.saxon.trans.XPathException if a function call refers to a function that has * not been declared */ public void bindUnboundFunctionCalls() throws XPathException { UnboundFunctionLibrary lib = (UnboundFunctionLibrary)functionLibraryList.get(unboundFunctionLibraryNr); lib.bindUnboundFunctionCalls(functionLibraryList, getConfiguration()); }
/** * Bind function calls that could not be bound when first encountered. These * will either be forwards references to functions declared later in the same query module, * or in modules that are being imported recursively, or errors. * <p/> * This method is for internal use only. * * @throws net.sf.saxon.trans.XPathException if a function call refers to a function that has * not been declared */ public void bindUnboundFunctionCalls() throws XPathException { UnboundFunctionLibrary lib = (UnboundFunctionLibrary)functionLibraryList.get(unboundFunctionLibraryNr); lib.bindUnboundFunctionCalls(functionLibraryList, getConfiguration()); }
/** * This method creates a copy of a FunctionLibrary: if the original FunctionLibrary allows * new functions to be added, then additions to this copy will not affect the original, or * vice versa. * * @return a copy of this function library. This must be an instance of the original class. */ public FunctionLibrary copy() { UnboundFunctionLibrary qfl = new UnboundFunctionLibrary(); qfl.unboundFunctionCalls = new ArrayList(unboundFunctionCalls); qfl.correspondingStaticContext = new ArrayList(correspondingStaticContext); return qfl; }
/** * Bind function calls that could not be bound when first encountered. These * will either be forwards references to functions declared later in the same query module, * or in modules that are being imported recursively, or errors. * <p>This method is for internal use only.</p> * * @throws net.sf.saxon.trans.XPathException * if a function call refers to a function that has * not been declared */ public void bindUnboundFunctionCalls() throws XPathException { UnboundFunctionLibrary lib = (UnboundFunctionLibrary) functionLibraryList.get(unboundFunctionLibraryNr); lib.bindUnboundFunctionReferences(functionLibraryList, getConfiguration()); }
/** * This method creates a copy of a FunctionLibrary: if the original FunctionLibrary allows * new functions to be added, then additions to this copy will not affect the original, or * vice versa. * * @return a copy of this function library. This must be an instance of the original class. */ /*@NotNull*/ public FunctionLibrary copy() { UnboundFunctionLibrary qfl = new UnboundFunctionLibrary(); qfl.unboundFunctionReferences = new ArrayList<>(unboundFunctionReferences); qfl.correspondingStaticContext = new ArrayList<>(correspondingStaticContext); qfl.resolving = resolving; return qfl; }
/** * This method creates a copy of a FunctionLibrary: if the original FunctionLibrary allows * new functions to be added, then additions to this copy will not affect the original, or * vice versa. * * @return a copy of this function library. This must be an instance of the original class. */ /*@NotNull*/ public FunctionLibrary copy() { UnboundFunctionLibrary qfl = new UnboundFunctionLibrary(); qfl.unboundFunctionReferences = new ArrayList<>(unboundFunctionReferences); qfl.correspondingStaticContext = new ArrayList<>(correspondingStaticContext); qfl.resolving = resolving; return qfl; }
/** * Reset function libraries */ private void resetFunctionLibraries() { Configuration config = getConfiguration(); if (isTopLevelModule()) { globalFunctionLibrary = new XQueryFunctionLibrary(config); } functionLibraryList = new FunctionLibraryList(); functionLibraryList.addFunctionLibrary( SystemFunctionLibrary.getSystemFunctionLibrary(SystemFunctionLibrary.XPATH_ONLY)); functionLibraryList.addFunctionLibrary(config.getVendorFunctionLibrary()); functionLibraryList.addFunctionLibrary(new ConstructorFunctionLibrary(config)); if (config.isAllowExternalFunctions()) { Configuration.getPlatform().addFunctionLibraries(functionLibraryList, config); } localFunctionLibraryNr = functionLibraryList.addFunctionLibrary( new XQueryFunctionLibrary(config)); importedFunctionLibraryNr = functionLibraryList.addFunctionLibrary( new ImportedFunctionLibrary(this, getTopLevelModule(this).getGlobalFunctionLibrary())); unboundFunctionLibraryNr = functionLibraryList.addFunctionLibrary( new UnboundFunctionLibrary()); }
/** * Reset function libraries */ private void resetFunctionLibraries() { Configuration config = getConfiguration(); if (isTopLevelModule()) { globalFunctionLibrary = new XQueryFunctionLibrary(config); } functionLibraryList = new FunctionLibraryList(); functionLibraryList.addFunctionLibrary( SystemFunctionLibrary.getSystemFunctionLibrary(SystemFunctionLibrary.XPATH_ONLY)); functionLibraryList.addFunctionLibrary(config.getVendorFunctionLibrary()); functionLibraryList.addFunctionLibrary(new ConstructorFunctionLibrary(config)); localFunctionLibraryNr = functionLibraryList.addFunctionLibrary( new XQueryFunctionLibrary(config)); importedFunctionLibraryNr = functionLibraryList.addFunctionLibrary( new ImportedFunctionLibrary(this, getTopLevelModule().getGlobalFunctionLibrary())); if (config.isAllowExternalFunctions()) { Configuration.getPlatform().addFunctionLibraries(functionLibraryList, config, Configuration.XQUERY); } unboundFunctionLibraryNr = functionLibraryList.addFunctionLibrary( new UnboundFunctionLibrary()); }
/** * Reset function libraries * * @param sqc The static query context set up by the caller */ private void initializeFunctionLibraries(/*@Nullable*/ StaticQueryContext sqc) { Configuration config = getConfiguration(); if (isTopLevelModule()) { globalFunctionLibrary = new XQueryFunctionLibrary(config); } functionLibraryList = new FunctionLibraryList(); functionLibraryList.addFunctionLibrary(getBuiltInFunctionSet()); functionLibraryList.addFunctionLibrary(config.getBuiltInExtensionLibraryList()); functionLibraryList.addFunctionLibrary(new ConstructorFunctionLibrary(config)); localFunctionLibraryNr = functionLibraryList.addFunctionLibrary( new XQueryFunctionLibrary(config)); importedFunctionLibraryNr = functionLibraryList.addFunctionLibrary( new ImportedFunctionLibrary(this, getTopLevelModule().getGlobalFunctionLibrary())); if (sqc != null && sqc.getExtensionFunctionLibrary() != null) { functionLibraryList.addFunctionLibrary(sqc.getExtensionFunctionLibrary()); } functionLibraryList.addFunctionLibrary(config.getIntegratedFunctionLibrary()); config.addExtensionBinders(functionLibraryList); unboundFunctionLibraryNr = functionLibraryList.addFunctionLibrary( new UnboundFunctionLibrary()); }
/** * Reset function libraries * * @param sqc The static query context set up by the caller */ private void initializeFunctionLibraries(/*@Nullable*/ StaticQueryContext sqc) { Configuration config = getConfiguration(); if (isTopLevelModule()) { globalFunctionLibrary = new XQueryFunctionLibrary(config); } functionLibraryList = new FunctionLibraryList(); functionLibraryList.addFunctionLibrary(getBuiltInFunctionSet()); functionLibraryList.addFunctionLibrary(config.getBuiltInExtensionLibraryList()); functionLibraryList.addFunctionLibrary(new ConstructorFunctionLibrary(config)); localFunctionLibraryNr = functionLibraryList.addFunctionLibrary( new XQueryFunctionLibrary(config)); importedFunctionLibraryNr = functionLibraryList.addFunctionLibrary( new ImportedFunctionLibrary(this, getTopLevelModule().getGlobalFunctionLibrary())); if (sqc != null && sqc.getExtensionFunctionLibrary() != null) { functionLibraryList.addFunctionLibrary(sqc.getExtensionFunctionLibrary()); } functionLibraryList.addFunctionLibrary(config.getIntegratedFunctionLibrary()); config.addExtensionBinders(functionLibraryList); unboundFunctionLibraryNr = functionLibraryList.addFunctionLibrary( new UnboundFunctionLibrary()); }