jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathFuncHereAPI.java
changeset 10694 cf59e2badd14
parent 1337 e8d6cef36199
equal deleted inserted replaced
10693:6e9ebed2e783 10694:cf59e2badd14
   171     *  @return A NodeIterator, should never be null.
   171     *  @return A NodeIterator, should never be null.
   172     *
   172     *
   173     * @throws TransformerException
   173     * @throws TransformerException
   174     * @deprecated
   174     * @deprecated
   175     */
   175     */
       
   176    @Deprecated
   176    public NodeIterator selectNodeIterator(
   177    public NodeIterator selectNodeIterator(
   177            Node contextNode, Node xpathnode, Node namespaceNode)
   178            Node contextNode, Node xpathnode, Node namespaceNode)
   178               throws TransformerException {
   179               throws TransformerException {
   179 
   180 
   180       // Execute the XPath, and have it return the result
   181       // Execute the XPath, and have it return the result
   193     *  @return A NodeIterator, should never be null.
   194     *  @return A NodeIterator, should never be null.
   194     *
   195     *
   195     * @throws TransformerException
   196     * @throws TransformerException
   196     * @deprecated
   197     * @deprecated
   197     */
   198     */
       
   199    @Deprecated
   198    public NodeList selectNodeList(Node contextNode, Node xpathnode)
   200    public NodeList selectNodeList(Node contextNode, Node xpathnode)
   199            throws TransformerException {
   201            throws TransformerException {
   200       return selectNodeList(contextNode, xpathnode, getStrFromNode(xpathnode), contextNode);
   202       return selectNodeList(contextNode, xpathnode, getStrFromNode(xpathnode), contextNode);
   201    }
   203    }
   202 
   204 
   237     *  @see com.sun.org.apache.xpath.internal.objects.XRTreeFrag
   239     *  @see com.sun.org.apache.xpath.internal.objects.XRTreeFrag
   238     *
   240     *
   239     * @throws TransformerException
   241     * @throws TransformerException
   240     * @deprecated
   242     * @deprecated
   241     */
   243     */
       
   244    @Deprecated
   242    public XObject eval(Node contextNode, Node xpathnode)
   245    public XObject eval(Node contextNode, Node xpathnode)
   243            throws TransformerException {
   246            throws TransformerException {
   244       return eval(contextNode, xpathnode, getStrFromNode(xpathnode),contextNode);
   247       return eval(contextNode, xpathnode, getStrFromNode(xpathnode),contextNode);
   245    }
   248    }
   246 
   249 
   373       return xpath.execute(this._funcHereContext, ctxtNode, prefixResolver);
   376       return xpath.execute(this._funcHereContext, ctxtNode, prefixResolver);
   374    }
   377    }
   375 
   378 
   376     private XPath createXPath(String str, PrefixResolver prefixResolver) throws TransformerException {
   379     private XPath createXPath(String str, PrefixResolver prefixResolver) throws TransformerException {
   377         XPath xpath = null;
   380         XPath xpath = null;
   378         Class[] classes = new Class[]{String.class, SourceLocator.class, PrefixResolver.class, int.class,
   381         Class<?>[] classes = new Class<?>[]{String.class, SourceLocator.class, PrefixResolver.class, int.class,
   379                 ErrorListener.class, FunctionTable.class};
   382                 ErrorListener.class, FunctionTable.class};
   380         Object[] objects = new Object[]{str, null, prefixResolver, new Integer(XPath.SELECT), null, _funcTable};
   383         Object[] objects = new Object[]{str, null, prefixResolver, new Integer(XPath.SELECT), null, _funcTable};
   381         try {
   384         try {
   382             Constructor constructor = XPath.class.getConstructor(classes);
   385             Constructor<XPath> constructor = XPath.class.getConstructor(classes);
   383             xpath = (XPath) constructor.newInstance(objects);
   386             xpath = constructor.newInstance(objects);
   384         } catch (Throwable t) {
   387         } catch (Throwable t) {
   385         }
   388         }
   386         if (xpath == null) {
   389         if (xpath == null) {
   387             xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null);
   390             xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null);
   388         }
   391         }