Package org.jdom.filter

Examples of org.jdom.filter.Filter


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

    /**
     * {@inheritDoc }
     */
    @Override
    public Element getOptionalElement(final String nodeName) {
         Iterator it = this.document.getDescendants(new Filter() {

            @Override
            public boolean matches(Object o) {
                if (o instanceof Element) {
                    if (((Element) o).getName().equalsIgnoreCase(nodeName.toLowerCase())) {
View Full Code Here

     */
    @Override
    public List<Element> getElements(final String nodeName) throws XmlException {

        List<Element> result = new ArrayList<Element>();
        Iterator it = this.document.getDescendants(new Filter() {

            @Override
            public boolean matches(Object o) {
                if (o instanceof Element) {
                    if (((Element) o).getName().equalsIgnoreCase(nodeName.toLowerCase())) {
View Full Code Here

        Element parent = text.getParent();

        int size = 0;
        int index = 0;
        if (parent != null) {
            Filter filter = new ContentFilter(ContentFilter.TEXT);
            List content = parent.getContent(filter);
            size = content.size();
            index = content.indexOf(text);
        }
        StringBuffer path = new StringBuffer();
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

        this.name = name;

        // this Filter will only match those elements that hava a "name"
        // attribute whose value is equal the name of the element being
        // managed
        nameFilter = new Filter() {
            // javadoc inherited
            public boolean matches(Object candidate) {
                boolean matched = false;
                if (candidate instanceof ODOMElement) {
                    // match if the element has a name attribute with the
View Full Code Here

    /**
     * Helper method.
     */
    private void depthFirstTraversal(ODOMObservable node) {
        final Filter filter = new Filter() {
            public boolean matches(Object o) {
                return o instanceof Text;
            }
        };
        if (node != null) {
View Full Code Here

            try {
                SAXBuilder saxbuilder = new SAXBuilder();
                Document docWireless = saxbuilder
                        .build(new File(micaboardFile));

                Filter filter = new ContentFilter(ContentFilter.ELEMENT);
                Iterator iteratorDocWireless = docWireless
                        .getDescendants(filter);

                while (iteratorDocWireless.hasNext()) {
                    Element e = (Element) iteratorDocWireless.next();
View Full Code Here

    Element result = null;
    if (parent != null) {
      int me = parent.indexOf(el);

      //--- check and see whether the element to be deleted is the last one of its kind
      Filter elFilter = new ElementFilter(uName,ns);
      if (parent.getContent(elFilter).size() == 1) {

        //--- get geonet child element with attribute name = unqualified name
        Filter chFilter = new ElementFilter(Edit.RootChild.CHILD, Edit.NAMESPACE);
        @SuppressWarnings("unchecked")
                List<Element> children = parent.getContent(chFilter);

        for (Element ch : children) {
          String name = ch.getAttributeValue("name");
View Full Code Here

TOP

Related Classes of org.jdom.filter.Filter

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.