Package org.apache.commons.jxpath

Examples of org.apache.commons.jxpath.JXPathContext.iterate()


        try {
            JXPathContext jxContext = JXPathContext.newContext(contextObj);
            setup(setup, jxContext, modeConf);

            List values = null;
            Iterator i = jxContext.iterate(name);
            if (i.hasNext()) {
                values = new LinkedList();
            }
            while (i.hasNext()) {
                values.add(i.next());
View Full Code Here


                        }
                    } else {
                        JXPathContext ctx = JXPathContext.newContext(ddRoot);
                        xpath = javify(xpath);
                        log.debug("Looking for XPath "+xpath+" on bean "+ddRoot.getClass().getName());
                        for(Iterator it = ctx.iterate(xpath); it.hasNext();) {
                            context.setCurrentStandardDD(ddRoot);
                            context.setCurrentNode(it.next());
                            ValidationResult temp = executeTest(cls, test, context);
                            result = resolveResult(result, temp);
                            if(result == ValidationResult.ABORTED) {
View Full Code Here

        if (ptr.getNode() != null) {
            // There are some nodes to load from

            JXPathContext multiValueContext = jctx.getRelativeContext(ptr);
            // build a jxpath iterator for pointers
            Iterator rowPointers = multiValueContext.iterate(this.rowPath);

            LinkedList list = new LinkedList();

            while (rowPointers.hasNext()) {
                Object value = rowPointers.next();
View Full Code Here

                        }
                    } else {
                        JXPathContext ctx = JXPathContext.newContext(ddRoot);
                        xpath = javify(xpath);
                        log.debug("Looking for XPath "+xpath+" on bean "+ddRoot.getClass().getName());
                        for(Iterator it = ctx.iterate(xpath); it.hasNext();) {
                            context.setCurrentStandardDD(ddRoot);
                            context.setCurrentNode(it.next());
                            ValidationResult temp = executeTest(cls, test, context);
                            result = resolveResult(result, temp);
                            if(result == ValidationResult.ABORTED) {
View Full Code Here

        if (ptr.getNode() != null) {
            // There are some nodes to load from

            JXPathContext multiValueContext = jctx.getRelativeContext(ptr);
            // build a jxpath iterator for pointers
            Iterator rowPointers = multiValueContext.iterate(this.rowPath);

            LinkedList list = new LinkedList();

            while (rowPointers.hasNext()) {
                Object value = rowPointers.next();
View Full Code Here

            Element element = (Element) pointer.getNode();
            Template template = new Template(element, this);
            template.setSystemId(systemId);
            templateList.add(template);
        }
        for (Iterator it = context.iterate("import/@href"); it.hasNext();) {
            String href = (String) it.next();
            InputSource importInputSource = new InputSource(uri.resolve(href).toString());
            org.w3c.dom.Document importDocument = db.parse(importInputSource);
            importTemplates(db, importDocument, importInputSource.getSystemId());
        }
View Full Code Here

  @SuppressWarnings("unchecked")
  public <T> Collection<T> getPath(Object root, String path) {
    final List<T> list = new LinkedList<T>();
    final JXPathContext context = JXPathContext.newContext(root);

    for (final Iterator<?> i = context.iterate(path); i.hasNext();) {
      final T next = (T) i.next();
      list.add(next);
    }
    return list;
  }
View Full Code Here

 
  @SuppressWarnings("unchecked")
  public <T> T getFirst(Object root, String path) {
    final JXPathContext context = JXPathContext.newContext(root);

    for (final Iterator<?> i = context.iterate(path); i.hasNext();) {
      return (T) i.next();
    }
    return null;
  }
 
View Full Code Here

        if (ptr.getNode() != null) {
            // There are some nodes to load from

            JXPathContext multiValueContext = jctx.getRelativeContext(ptr);
            // build a jxpath iterator for pointers
            Iterator rowPointers = multiValueContext.iterate(this.rowPath);

            LinkedList list = new LinkedList();

            while (rowPointers.hasNext()) {
                Object value = rowPointers.next();
View Full Code Here

        try {
            JXPathContext jxContext = JXPathContext.newContext(contextObj);
            setup(setup, jxContext, modeConf);

            List values = null;
            Iterator i = jxContext.iterate(name);
            if (i.hasNext()) {
                values = new LinkedList();
            }
            while (i.hasNext()) {
                values.add(i.next());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.