Package org.jdom.filter

Examples of org.jdom.filter.ElementFilter


        }
      }
      node = (Element)_node.clone();   

      if(reorder) {
        Filter elementFilter2 = new ElementFilter( "job_chain_node.job_chain", getChain().getNamespace() );
        // gets all element nodes under the rootElement
        List elements = getChain().getContent( elementFilter2 );
        // cycle through all immediate elements under the rootElement
        //for( java.util.Iterator it = elements.iterator(); it.hasNext(); ) {
        int size = elements.size();
View Full Code Here


        }
      }
      node = (Element)_node.clone();   

      if(reorder) {
        Filter elementFilter2 = new ElementFilter( "job_chain_node", getChain().getNamespace() );
        // gets all element nodes under the rootElement
        List elements = getChain().getContent( elementFilter2 );
        // cycle through all immediate elements under the rootElement
        //for( java.util.Iterator it = elements.iterator(); it.hasNext(); ) {
        int size = elements.size();
View Full Code Here

            {
                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

                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

                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

            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

        // 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

                    "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

            // 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

                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

TOP

Related Classes of org.jdom.filter.ElementFilter

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.