/** * Set an object that will be used to resolve URIs used in * fn:unparsed-text() and related functions. * * @param resolver An object that implements the UnparsedTextURIResolver interface, or * null. * @since 9.5 */ public void setUnparsedTextURIResolver(UnparsedTextURIResolver resolver) { contextObject.getController().setUnparsedTextURIResolver(resolver); }
/** * Get the collection finder associated with this configuration. This is used to dereference * collection URIs used in the fn:collection and fn:uri-collection functions * * @return the CollectionFinder to be used * @since 9.7 */ public CollectionFinder getCollectionFinder() { return contextObject.getController().getCollectionFinder(); }
/** * Set the collection finder associated with this configuration. This is used to dereference * collection URIs used in the fn:collection and fn:uri-collection functions * * @param cf the CollectionFinder to be used * @since 9.7 */ public void setCollectionFinder(CollectionFinder cf) { contextObject.getController().setCollectionFinder(cf); }
/** * Get the CollectionURIResolver used for resolving references to collections. * If none has been set on the Controller, returns the * CollectionURIResolver registered with the Configuration * * @return the resolver for references to collections * @since 9.4 * @deprecated since 9.7 - use {@link #getCollectionFinder()} */ public CollectionURIResolver getCollectionURIResolver() { return contextObject.getController().getCollectionURIResolver(); }
/** * Set the CollectionURIResolver used for resolving collection URIs. * Defaults to the CollectionURIResolver registered with the Configuration * * @param resolver the resolver for references to collections * @since 9.4 * @deprecated since 9.7 - use {@link #setCollectionFinder(CollectionFinder)} */ public void setCollectionURIResolver(CollectionURIResolver resolver) { contextObject.getController().setCollectionURIResolver(resolver); }
/** * Get the URI resolver for unparsed text. * * @return the user-supplied unparsed text URI resolver if there is one, or the * system-defined one otherwise * @since 9.5 */ public UnparsedTextURIResolver getUnparsedTextURIResolver() { return contextObject.getController().getUnparsedTextURIResolver(); }
/** * Get the URI resolver for unparsed text. * * @return the user-supplied unparsed text URI resolver if there is one, or the * system-defined one otherwise * @since 9.5 */ public UnparsedTextURIResolver getUnparsedTextURIResolver() { return contextObject.getController().getUnparsedTextURIResolver(); }
/** * Get the collection finder associated with this configuration. This is used to dereference * collection URIs used in the fn:collection and fn:uri-collection functions * * @return the CollectionFinder to be used * @since 9.7 */ public CollectionFinder getCollectionFinder() { return contextObject.getController().getCollectionFinder(); }
/** * Set an object that will be used to resolve URIs used in * fn:unparsed-text() and related functions. * * @param resolver An object that implements the UnparsedTextURIResolver interface, or * null. * @since 9.5 */ public void setUnparsedTextURIResolver(UnparsedTextURIResolver resolver) { contextObject.getController().setUnparsedTextURIResolver(resolver); }
/** * Set the CollectionURIResolver used for resolving collection URIs. * Defaults to the CollectionURIResolver registered with the Configuration * * @param resolver the resolver for references to collections * @since 9.4 * @deprecated since 9.7 - use {@link #setCollectionFinder(CollectionFinder)} */ public void setCollectionURIResolver(CollectionURIResolver resolver) { contextObject.getController().setCollectionURIResolver(resolver); }
/** * Get the CollectionURIResolver used for resolving references to collections. * If none has been set on the Controller, returns the * CollectionURIResolver registered with the Configuration * * @return the resolver for references to collections * @since 9.4 * @deprecated since 9.7 - use {@link #getCollectionFinder()} */ public CollectionURIResolver getCollectionURIResolver() { return contextObject.getController().getCollectionURIResolver(); }
/** * Set the collection finder associated with this configuration. This is used to dereference * collection URIs used in the fn:collection and fn:uri-collection functions * * @param cf the CollectionFinder to be used * @since 9.7 */ public void setCollectionFinder(CollectionFinder cf) { contextObject.getController().setCollectionFinder(cf); }
/** * Get the current mode. * * @return the current mode. May return null if the current mode is the default mode. */ public Component.M getCurrentMode() { Component.M m = currentMode; if (m == null) { RuleManager rm = getController().getRuleManager(); if (rm != null) { return rm.getUnnamedMode().getDeclaringComponent(); } else { return null; } } else { return m; } }
/** * Get the current mode. * * @return the current mode. May return null if the current mode is the default mode. */ public Component.M getCurrentMode() { Component.M m = currentMode; if (m == null) { RuleManager rm = getController().getRuleManager(); if (rm != null) { return rm.getUnnamedMode().getDeclaringComponent(); } else { return null; } } else { return m; } }
/** * Get the Base URI for the node, that is, the URI used for resolving a relative URI contained * in the node. This will be the same as the System ID unless xml:base has been used. * * @return the base URI of the node */ public String getBaseURI() { if (node == null) { // the base URI of a constructed parentless document or element node is the static base URI of the // instruction/expression that created it PipelineConfiguration pipe = savedXPathContext.getController().makePipelineConfiguration(); return pipe.getLocationProvider().getSystemId(instruction.getLocationId()); } else { return node.getBaseURI(); } }
/** * Get the Base URI for the node, that is, the URI used for resolving a relative URI contained * in the node. This will be the same as the System ID unless xml:base has been used. * * @return the base URI of the node */ public String getBaseURI() { if (node == null) { // the base URI of a constructed parentless document or element node is the static base URI of the // instruction/expression that created it PipelineConfiguration pipe = savedXPathContext.getController().makePipelineConfiguration(); return pipe.getLocationProvider().getSystemId(instruction.getLocationId()); } else { return node.getBaseURI(); } }
/** * Get a PullProvider that delivers the stream of events corresponding to the tree rooted at this virtual node * @return the PullProvider for the events in the virtual tree */ public PullProvider getPuller() { if (node == null) { VirtualTreeWalker walker = new VirtualTreeWalker(instruction, savedXPathContext); walker.setPipelineConfiguration(savedXPathContext.getController().makePipelineConfiguration()); walker.setNameCode(getNameCode()); return walker; } else { return TreeWalker.makeTreeWalker(node); } }
/** * Get a PullProvider that delivers the stream of events corresponding to the tree rooted at this virtual node * @return the PullProvider for the events in the virtual tree */ public PullProvider getPuller() { if (node == null) { VirtualTreeWalker walker = new VirtualTreeWalker(instruction, savedXPathContext); walker.setPipelineConfiguration(savedXPathContext.getController().makePipelineConfiguration()); walker.setNameCode(getNameCode()); return walker; } else { return TreeWalker.makeTreeWalker(node); } }
/** * Evaluate the variable. That is, * get the value of the select expression if present or the content * of the element otherwise, either as a tree or as a sequence */ public ValueRepresentation getSelectValue(XPathContext context) throws XPathException { if (select==null) { throw new AssertionError("*** No select expression for global variable $" + getVariableQName().getDisplayName() + "!!"); } else { XPathContextMajor c2 = context.newCleanContext(); c2.setOrigin(this); UnfailingIterator initialNode = SingletonIterator.makeIterator(c2.getController().getContextForGlobalVariables()); initialNode.next(); c2.setCurrentIterator(initialNode); if (stackFrameMap != null) { c2.openStackFrame(stackFrameMap); } return ExpressionTool.evaluate(select, evaluationMode, c2, referenceCount); } }
/** * Evaluate the variable. That is, * get the value of the select expression if present or the content * of the element otherwise, either as a tree or as a sequence */ public ValueRepresentation getSelectValue(XPathContext context) throws XPathException { if (select==null) { throw new AssertionError("*** No select expression for global variable $" + getVariableQName().getDisplayName() + "!!"); } else { XPathContextMajor c2 = context.newCleanContext(); c2.setOrigin(this); UnfailingIterator initialNode = SingletonIterator.makeIterator(c2.getController().getContextForGlobalVariables()); initialNode.next(); c2.setCurrentIterator(initialNode); if (stackFrameMap != null) { c2.openStackFrame(stackFrameMap); } return ExpressionTool.evaluate(select, evaluationMode, c2, referenceCount); } }