/** * 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() { ImportedFunctionLibrary lib = new ImportedFunctionLibrary(importingModule, baseLibrary); for (String ns : namespaces) { lib.addImportedNamespace(ns); } return lib; }
/** * Register that this module imports a particular module namespace * <p>This method is intended for internal use.</p> * * @param uri the URI of the imported namespace. */ public void addImportedNamespace(String uri) { if (importedModuleNamespaces == null) { importedModuleNamespaces = new HashSet<>(5); } importedModuleNamespaces.add(uri); getImportedFunctionLibrary().addImportedNamespace(uri); }
/** * 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()); }
/** * Register that this module imports a particular module namespace * <p>This method is intended for internal use.</p> * * @param uri the URI of the imported namespace. */ public void addImportedNamespace(String uri) { if (importedModuleNamespaces == null) { importedModuleNamespaces = new HashSet(5); } importedModuleNamespaces.add(uri); getImportedFunctionLibrary().addImportedNamespace(uri); }
/** * 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()); }
/** * 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() { ImportedFunctionLibrary lib = new ImportedFunctionLibrary(importingModule, baseLibrary); for (String ns : namespaces) { lib.addImportedNamespace(ns); } return lib; }
/** * Register that this module imports a particular module namespace * <p>This method is intended for internal use.</p> * * @param uri the URI of the imported namespace. */ public void addImportedNamespace(String uri) { if (importedModuleNamespaces == null) { importedModuleNamespaces = new HashSet<>(5); } importedModuleNamespaces.add(uri); getImportedFunctionLibrary().addImportedNamespace(uri); }
/** * 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()); }
/** * 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() { ImportedFunctionLibrary lib = new ImportedFunctionLibrary(importingModule, baseLibrary); Iterator iter = namespaces.iterator(); while (iter.hasNext()) { String ns = (String)iter.next(); lib.addImportedNamespace(ns); } return lib; }
/** * Register that this module imports a particular module namespace * <p>This method is intended for internal use.</p> * * @param uri the URI of the imported namespace. */ public void addImportedNamespace(String uri) { if (importedModuleNamespaces == null) { importedModuleNamespaces = new HashSet(5); } importedModuleNamespaces.add(uri); getImportedFunctionLibrary().addImportedNamespace(uri); }
/** * 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()); }
/** * 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() { ImportedFunctionLibrary lib = new ImportedFunctionLibrary(importingModule, baseLibrary); Iterator iter = namespaces.iterator(); while (iter.hasNext()) { String ns = (String)iter.next(); lib.addImportedNamespace(ns); } return lib; }