Examples of ContentFilter


Examples of org.jdom.filter.ContentFilter

            List siblings = null;
            int nodeType = ContentFilter.COMMENT;
            StringBuffer path = getElementPath(from, parent, false);

            if (parent != null) {
                siblings = parent.getContent(new ContentFilter(nodeType));
            }
            else {
                Document doc = to.getDocument();
                if (doc != null) {
                    siblings = doc.getContent(new ContentFilter(nodeType));
                }
            }
            return getPositionPath(to, siblings, "comment()", path).toString();
        }
    }
View Full Code Here

Examples of org.jdom.filter.ContentFilter

            List siblings = null;
            int nodeType = ContentFilter.PI;
            StringBuffer path = getElementPath(from, parent, false);

            if (parent != null) {
                siblings = parent.getContent(new ContentFilter(nodeType));
            }
            else {
                Document doc = to.getDocument();
                if (doc != null) {
                    siblings = doc.getContent(new ContentFilter(nodeType));
                }
            }
            return getPositionPath(to, siblings,
                                   "processing-instruction()", path).toString();
        }
View Full Code Here

Examples of org.jdom.filter.ContentFilter

        }
    }

    private void normaliseLineEndings( Document document )
    {
        for ( Iterator<?> i = document.getDescendants( new ContentFilter( ContentFilter.COMMENT ) ); i.hasNext(); )
        {
            Comment c = (Comment) i.next();
            c.setText( ReleaseUtil.normalizeLineEndings( c.getText(), ls ) );
        }
        for ( Iterator<?> i = document.getDescendants( new ContentFilter( ContentFilter.CDATA ) ); i.hasNext(); )
        {
            CDATA c = (CDATA) i.next();
            c.setText( ReleaseUtil.normalizeLineEndings( c.getText(), ls ) );
        }
    }
View Full Code Here

Examples of org.jdom.filter.ContentFilter

        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

Examples of org.jdom.filter.ContentFilter

      }
    }
  }

  private void normaliseLineEndings(Document document) {
    for (Iterator i = document.getDescendants(new ContentFilter(ContentFilter.COMMENT)); i.hasNext();) {
      Comment c = (Comment) i.next();
      c.setText(c.getText().replaceAll("\n", SEPARATOR));
    }
  }
View Full Code Here

Examples of org.jdom.filter.ContentFilter

            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

Examples of org.jdom.filter.ContentFilter

        }
    }

    private void normaliseLineEndings( Document document )
    {
        for ( Iterator i = document.getDescendants( new ContentFilter( ContentFilter.COMMENT ) ); i.hasNext(); )
        {
            Comment c = (Comment) i.next();
            c.setText( ReleaseUtil.normalizeLineEndings( c.getText(), ls ) );
        }
        for ( Iterator i = document.getDescendants( new ContentFilter( ContentFilter.CDATA ) ); i.hasNext(); )
        {
            CDATA c = (CDATA) i.next();
            c.setText( ReleaseUtil.normalizeLineEndings( c.getText(), ls ) );
        }
    }
View Full Code Here

Examples of org.jdom.filter.ContentFilter

             }
            Element message = buildError.getChild("message");
            if (message == null) {
                throw new CruiseControlException("Expected a message element under build/failure/builderror");
            }
            List matches = message.getContent(new ContentFilter(ContentFilter.CDATA));
            if (matches.size() == 0) {
                throw new CruiseControlException("Expected CDATA content in build/failure/builderror/message/element");
            }
            String errorMessage = ((CDATA) matches.get(0)).getText();
            buildLogElement.setAttribute(new Attribute("error", errorMessage));
View Full Code Here

Examples of org.jdom.filter.ContentFilter

   */
  private static List<String> findRootComments(Document jdomDocument) {
    List<String> comments = new ArrayList<String>();
   
    for (Object o : jdomDocument.getContent(
        new ContentFilter(ContentFilter.COMMENT))) {
     
      comments.add(((Comment) o).getText().trim());
    }
   
    return comments;
View Full Code Here

Examples of org.jdom.filter.ContentFilter

      addRendererElement(componentInfo, componentTag, renderer, namespace);
    }
  }

  private void normaliseLineEndings(final Document document) {
    final Iterator i = document.getDescendants(new ContentFilter(ContentFilter.COMMENT));
    while (i.hasNext()) {
      final Comment c = (Comment) i.next();
      c.setText(c.getText().replaceAll("\n", SEPARATOR));
    }
  }
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.