Package com.sun.org.apache.xpath.internal

Examples of com.sun.org.apache.xpath.internal.CachedXPathAPI


     * Sets the doc for the xpath transformation. Resets the cache if needed
     * @param doc
     */
    public static void setDoc(Document doc) {
        if (localDoc.get()!=doc) {
            CachedXPathAPI cx=(CachedXPathAPI)local.get();
            if (cx==null) {
                cx=new CachedXPathAPI();
                local.set(cx);
                localDoc.set(doc);
                return;
            }
            //Different docs reset.
            cx.getXPathContext().reset();
            localDoc.set(doc);
        }
    }
View Full Code Here


    /**
     * @return the cachexpathapi for this thread
     */
    public static CachedXPathAPI getCachedXPathAPI() {
        CachedXPathAPI cx=(CachedXPathAPI)local.get();
        if (cx==null) {
            cx=new CachedXPathAPI();
            local.set(cx);
            localDoc.set(null);
        }
        return cx;
    }
View Full Code Here

        // Wait all acks being processed
        Thread.sleep(100);
    }
   
    protected String textValueOfXPath(Node node, String xpath) throws TransformerException {
        CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
        NodeIterator iterator = cachedXPathAPI.selectNodeIterator(node, xpath);
        Node root = iterator.nextNode();
        if (root instanceof Element) {
            Element element = (Element) root;
            if (element == null) {
                return "";
View Full Code Here

        //return ((int) (Math.random() * 19) + 1);
        return 10;
    }
   
    protected String textValueOfXPath(Node node, String xpath) throws TransformerException {
        CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
        NodeIterator iterator = cachedXPathAPI.selectNodeIterator(node, xpath);
        Node root = iterator.nextNode();
        if (root instanceof Element) {
            Element element = (Element) root;
            if (element == null) {
                return "";
View Full Code Here

         * Sets the doc for the xpath transformation. Resets the cache if needed
         * @param doc
         */
        public static void setDoc(Document doc) {
       if (localDoc.get()!=doc) {
            CachedXPathAPI cx=(CachedXPathAPI)local.get();
            if (cx==null) {
               cx=new CachedXPathAPI();
               local.set(cx);
               localDoc.set(doc);
               return;
            }
            //Different docs reset.
            cx.getXPathContext().reset();
            localDoc.set(doc);
        }
        }
View Full Code Here

        }
    /**
     * @return the cachexpathapi for this thread
     */
    public static CachedXPathAPI getCachedXPathAPI() {
        CachedXPathAPI cx=(CachedXPathAPI)local.get();
        if (cx==null) {
            cx=new CachedXPathAPI();
            local.set(cx);
            localDoc.set(null);
        }
        return cx;
    }
View Full Code Here

TOP

Related Classes of com.sun.org.apache.xpath.internal.CachedXPathAPI

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.