Examples of ElementFilter


Examples of org.jdom.filter.ElementFilter

            {
                rootElement.setAttribute( "schemaLocation", "http://maven.apache.org/POM/4.0.0 "
                    + ( isPom ? POM_XSD_URL : SETTINGS_XSD_URL ), xsiNamespace );
            }

            ElementFilter elementFilter = new ElementFilter( Namespace.getNamespace( "" ) );
            for ( Iterator<?> i = rootElement.getDescendants( elementFilter ); i.hasNext(); )
            {
                Element e = (Element) i.next();
                e.setNamespace( pomNamespace );
            }
View Full Code Here

Examples of org.jdom.filter.ElementFilter

                rootElement.setAttribute( "schemaLocation", "http://maven.apache.org/POM/" + modelVersion
                    + " http://maven.apache.org/maven-v" + modelVersion.replace( '.', '_' ) + ".xsd", xsiNamespace );
            }

            // the empty namespace is considered equal to the POM namespace, so match them up to avoid extra xmlns=""
            ElementFilter elementFilter = new ElementFilter( Namespace.getNamespace( "" ) );
            for ( Iterator<?> i = rootElement.getDescendants( elementFilter ); i.hasNext(); )
            {
                Element e = (Element) i.next();
                e.setNamespace( pomNamespace );
            }
View Full Code Here

Examples of org.jdom.filter.ElementFilter

                rootElement.setAttribute( "schemaLocation", "http://maven.apache.org/POM/" + modelVersion
                    + " http://maven.apache.org/maven-v" + modelVersion.replace( '.', '_' ) + ".xsd", xsiNamespace );
            }

            // the empty namespace is considered equal to the POM namespace, so match them up to avoid extra xmlns=""
            ElementFilter elementFilter = new ElementFilter( Namespace.getNamespace( "" ) );
            for ( Iterator<?> i = rootElement.getDescendants( elementFilter ); i.hasNext(); )
            {
                Element e = (Element) i.next();
                e.setNamespace( pomNamespace );
            }
View Full Code Here

Examples of org.jdom.filter.ElementFilter

            Element parent = element.getParent();
            int size = 1;
            int index = 0;

            if (parent != null) {
                Filter filter = new ElementFilter(element.getName());
                List elements = parent.getContent(filter);
                size = elements.size();
                index = elements.indexOf(element);
            }
View Full Code Here

Examples of org.jdom.filter.ElementFilter

        // Retrieve the definitions document and root element.
        Document definitionsDoc = this.accessor.getDevicePolicyDefinitions();
        Element rootElement = definitionsDoc.getRootElement();

        // Create the category element filter used by the PolicyNameIterator.
        final ElementFilter categoryElementFilter =
                new ElementFilter(
                        DeviceRepositorySchemaConstants.CATEGORY_ELEMENT_NAME,
                        rootElement.getNamespace());

        // Get the category element content, if any.
        List categoryList =
View Full Code Here

Examples of org.jdom.filter.ElementFilter

                    "named " + categoryName);
        }

        // Create the policy element filter which retrieves all policy
        // element children of the category element.
        final ElementFilter policyElementFilter =
                new ElementFilter(
                        DeviceRepositorySchemaConstants.POLICY_ELEMENT_NAME,
                        rootElement.getNamespace());

        // Get an iterator for the category element's policy element content.
        final Iterator policyElementIterator =
View Full Code Here

Examples of org.jdom.filter.ElementFilter

            // check to see if the predicate is actually needed.
            // retrieve the namespace associated with the child
            Namespace ns = Namespace.getNamespace(namespaceURI);
            // retrieve the children with the given name and namespace.
            // Unfortunately this generates unavoidable garbage.
            List children = element.getContent(new ElementFilter(localName,
                                                                 ns));
            // only need the predicate if there is more than one child
            needsPredicate = children.size() > 1;

        }
View Full Code Here

Examples of org.jdom.filter.ElementFilter

                controller.setDeviceName(deviceName);

                Element originalPolicy = listModifier.getPolicy();
                final Namespace ns = originalPolicy.getNamespace();
                final ElementFilter elementFilter = new ElementFilter(ns);

                Element standardElement =
                        originalPolicy.getChild(DeviceRepositorySchemaConstants.
                        STANDARD_ELEMENT_NAME, ns);
View Full Code Here

Examples of org.jdom.filter.ElementFilter

               element,
               "countKey");

        // Check against "other"
        element = (ODOMElement)element.getParent().getContent(
            new ElementFilter()).get(1);

        // Check the XPath cache
        doTest(constraint,
               element,
               null);
View Full Code Here

Examples of org.jdom.filter.ElementFilter

            }

            // Get the element children, filtering also on namespace.
            List typeContent =
                    typeElement.getContent(
                            new ElementFilter(typeElement.getNamespace()));

            // element should be e.g. <boolean />
            Element emptyPolicyType = (Element) typeContent.get(0);

            if (emptyPolicyType == null) {
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.