javax.xml.xpath

Interface XPath

    • Method Detail

      • reset

        void reset()

        Reset this XPath to its original configuration.

        XPath is reset to the same state as when it was created with XPathFactory.newXPath(). reset() is designed to allow the reuse of existing XPaths thus saving resources associated with the creation of new XPaths.

        The reset XPath is not guaranteed to have the same XPathFunctionResolver, XPathVariableResolver or NamespaceContext Objects, e.g. Object.equals(Object obj). It is guaranteed to have a functionally equal XPathFunctionResolver, XPathVariableResolver and NamespaceContext.

      • setXPathVariableResolver

        void setXPathVariableResolver(XPathVariableResolver resolver)

        Establish a variable resolver.

        A NullPointerException is thrown if resolver is null.

        Parameters:
        resolver - Variable resolver.
        Throws:
        NullPointerException - If resolver is null.
      • getXPathVariableResolver

        XPathVariableResolver getXPathVariableResolver()

        Return the current variable resolver.

        null is returned in no variable resolver is in effect.

        Returns:
        Current variable resolver.
      • setXPathFunctionResolver

        void setXPathFunctionResolver(XPathFunctionResolver resolver)

        Establish a function resolver.

        A NullPointerException is thrown if resolver is null.

        Parameters:
        resolver - XPath function resolver.
        Throws:
        NullPointerException - If resolver is null.
      • getXPathFunctionResolver

        XPathFunctionResolver getXPathFunctionResolver()

        Return the current function resolver.

        null is returned in no function resolver is in effect.

        Returns:
        Current function resolver.
      • setNamespaceContext

        void setNamespaceContext(NamespaceContext nsContext)

        Establish a namespace context.

        A NullPointerException is thrown if nsContext is null.

        Parameters:
        nsContext - Namespace context to use.
        Throws:
        NullPointerException - If nsContext is null.
      • getNamespaceContext

        NamespaceContext getNamespaceContext()

        Return the current namespace context.

        null is returned in no namespace context is in effect.

        Returns:
        Current Namespace context.
      • evaluate

        Object evaluate(String expression,
                      Object item,
                      QName returnType)
                        throws XPathExpressionException

        Evaluate an XPath expression in the specified context and return the result as the specified type.

        See Evaluation of XPath Expressions for context item evaluation, variable, function and QName resolution and return type conversion.

        If returnType is not one of the types defined in XPathConstants ( NUMBER, STRING, BOOLEAN, NODE or NODESET) then an IllegalArgumentException is thrown.

        If a null value is provided for item, an empty document will be used for the context. If expression or returnType is null, then a NullPointerException is thrown.

        Parameters:
        expression - The XPath expression.
        item - The starting context (a node, for example).
        returnType - The desired return type.
        Returns:
        Result of evaluating an XPath expression as an Object of returnType.
        Throws:
        XPathExpressionException - If expression cannot be evaluated.
        IllegalArgumentException - If returnType is not one of the types defined in XPathConstants.
        NullPointerException - If expression or returnType is null.

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Version en cache

05/11/2024 20:48:06 Cette version de la page est en cache (à la date du 05/11/2024 20:48:06) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.

Document créé le 29/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/xml/xpath/XPath.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com, XPath

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.

Table des matières Haut