Examples of ElementIterator


Examples of com.google.wave.api.BlipIterator.ElementIterator

        new ArrayList<String>(), wavelet);

    Map<String, String> restrictions = new HashMap<String, String>();
    restrictions.put("url", "http://www.google.com/gadget.xml");

    ElementIterator iterator = new BlipIterator.ElementIterator(blip, ElementType.GADGET,
        restrictions, -1);

    List<Range> hits = new ArrayList<Range>();
    while (iterator.hasNext()) {
      hits.add(iterator.next());
    }
    assertEquals(2, hits.size());
    assertEquals(1, hits.get(0).getStart());
    assertEquals(2, hits.get(0).getEnd());
    assertEquals(5, hits.get(1).getStart());
View Full Code Here

Examples of javax.swing.text.ElementIterator

        return threshold;
    }

    public Element getElement(final Element e, final Object attribute,
                              final Object value) {
        final ElementIterator it = new ElementIterator(e);
        while (it.next() != null) {
            final Element current = it.current();
            if (current.getAttributes().containsAttribute(attribute, value)) {
                return current;
            }
        }
        return null;
View Full Code Here

Examples of javax.swing.text.ElementIterator

                setOuterHTML(parent, "<frame src=\"" + src + "\">");
            } catch (BadLocationException e) {
            } catch (IOException e) {
            }
        } else {
            final ElementIterator frameIterator = new ElementIterator(getDefaultRootElement());
            if (frameIterator != null) {
                while (frameIterator.next() != null) {
                    final Element element = frameIterator.current();
                    if (Tag.FRAME.equals(element.getName())
                        && element.getAttributes().containsAttribute(HTML.Attribute.NAME, target)) {
                       
                        processTarget(element, src);
                    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.xml.ElementIterator

            throw new IllegalArgumentException("DAV:multistatus element expected.");
        }

        MultiStatus multistatus = new MultiStatus();

        ElementIterator it = DomUtil.getChildren(multistatusElement, XML_RESPONSE, NAMESPACE);
        while (it.hasNext()) {
            Element respElem = it.nextElement();
            MultiStatusResponse response = MultiStatusResponse.createFromXml(respElem);
            multistatus.addResponse(response);
        }

        // optional response description on the multistatus element
View Full Code Here

Examples of org.apache.jackrabbit.webdav.xml.ElementIterator

        if (!DomUtil.matches(lockDiscoveryElement, PROPERTY_LOCKDISCOVERY, NAMESPACE)) {
            throw new IllegalArgumentException("DAV:lockdiscovery element expected.");
        }

        List<ActiveLock> activeLocks = new ArrayList<ActiveLock>();
        ElementIterator it = DomUtil.getChildren(lockDiscoveryElement, XML_ACTIVELOCK, NAMESPACE);
        while (it.hasNext()) {
            Element al = it.nextElement();
            activeLocks.add(new ALockImpl(al));
        }

        return new LockDiscovery(activeLocks.toArray(new ActiveLock[activeLocks.size()]));
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.xml.ElementIterator

    public static AclProperty createFromXml(Element aclElement) throws DavException {
        if (!DomUtil.matches(aclElement, SecurityConstants.ACL.getName(), SecurityConstants.ACL.getNamespace())) {
            throw new DavException(DavServletResponse.SC_BAD_REQUEST, "ACL request requires a DAV:acl body.");
        }
        List<Ace> aces = new ArrayList<Ace>();
        ElementIterator it = DomUtil.getChildren(aclElement, Ace.XML_ACE, SecurityConstants.NAMESPACE);
        while (it.hasNext()) {
            Element aceElem = it.nextElement();
            aces.add(Ace.createFromXml(aceElem));
        }
        return new AclProperty(aces);
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.xml.ElementIterator

                gdElem = DomUtil.getChildElement(aceElement, XML_GRANT, NAMESPACE);
            } else {
                gdElem = DomUtil.getChildElement(aceElement, XML_DENY, NAMESPACE);
            }
            List<Privilege> privilegeList = new ArrayList<Privilege>();
            ElementIterator privIt = DomUtil.getChildren(gdElem, Privilege.XML_PRIVILEGE, NAMESPACE);
            while (privIt.hasNext()) {
               Privilege pv = Privilege.getPrivilege(privIt.nextElement());
               privilegeList.add(pv);
            }
            Privilege[] privileges = privilegeList.toArray(new Privilege[privilegeList.size()]);

            boolean isProtected = DomUtil.hasChildElement(aceElement, XML_PROTECTED, NAMESPACE);
View Full Code Here

Examples of org.apache.jackrabbit.webdav.xml.ElementIterator

        if (!DomUtil.matches(optionsElement, DeltaVConstants.XML_OPTIONS, DeltaVConstants.NAMESPACE)) {
            log.warn("DAV:options element expected");
            throw new DavException(DavServletResponse.SC_BAD_REQUEST);
        }
        OptionsInfo oInfo = new OptionsInfo();
        ElementIterator it = DomUtil.getChildren(optionsElement);
        while (it.hasNext()) {
            // todo: not correct since assuming its the deltaV-namespace
            oInfo.entriesLocalNames.add(it.nextElement().getLocalName());
        }
        return oInfo;
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.xml.ElementIterator

            Status status = Status.parse(statusLine);
            response = new MultiStatusResponse(href, status, responseDescription);
        } else {
            response = new MultiStatusResponse(href, responseDescription, TYPE_PROPSTAT);
            // read propstat elements
            ElementIterator it = DomUtil.getChildren(responseElement, XML_PROPSTAT, NAMESPACE);
            while (it.hasNext()) {
                Element propstat = it.nextElement();
                String propstatus = DomUtil.getChildText(propstat, XML_STATUS, NAMESPACE);
                Element prop = DomUtil.getChildElement(propstat, XML_PROP, NAMESPACE);
                if (propstatus != null && prop != null) {
                    int statusCode = Status.parse(propstatus).getStatusCode();
                    ElementIterator propIt = DomUtil.getChildren(prop);
                    while (propIt.hasNext()) {
                        Element el = propIt.nextElement();
                        /*
                        always build dav property from the given element, since
                        distinction between prop-names and properties not having
                        a value is not possible.
                        retrieval of the set of 'property names' is possible from
View Full Code Here

Examples of org.apache.jackrabbit.webdav.xml.ElementIterator

            throw new DavException(DavServletResponse.SC_BAD_REQUEST, "PropFind-Request has no <propfind> tag.");
        }
       
        DavPropertyNameSet include = null;

        ElementIterator it = DomUtil.getChildren(root);
        int propfindTypeFound = 0;
       
        while (it.hasNext()) {
            Element child = it.nextElement();
            String nodeName = child.getLocalName();
            if (NAMESPACE.getURI().equals(child.getNamespaceURI())) {
                if (XML_PROP.equals(nodeName)) {
                    propfindType = PROPFIND_BY_PROPERTY;
                    propfindProps = new DavPropertyNameSet(child);
                    propfindTypeFound += 1;
                }
                else if (XML_PROPNAME.equals(nodeName)) {
                    propfindType = PROPFIND_PROPERTY_NAMES;
                    propfindTypeFound += 1;
                }
                else if (XML_ALLPROP.equals(nodeName)) {
                    propfindType = PROPFIND_ALL_PROP;
                    propfindTypeFound += 1;
                }
                else if (XML_INCLUDE.equals(nodeName)) {
                    include = new DavPropertyNameSet();
                    ElementIterator pit = DomUtil.getChildren(child);
                    while (pit.hasNext()) {
                        include.add(DavPropertyName.createFromXml(pit.nextElement()));
                    }
                }
            }
        }
       
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.