Package org.jdom

Examples of org.jdom.Comment


    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


    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

        return pi.getData();
    }

    public String getCommentStringValue(Object obj)
    {
        Comment cmt = (Comment) obj;

        return cmt.getText();
    }
View Full Code Here

            proxy.addContent(new EntityRef("a"));
            fail("Expected an UnsupportedOperationException");
        } catch (UnsupportedOperationException e) {
        }
        try {
            proxy.addContent(new Comment(""));
            fail("Expected an UnsupportedOperationException");
        } catch (UnsupportedOperationException e) {
        }
    }
View Full Code Here

            fail("Expected an UnsupportedOperationException");
        } catch (UnsupportedOperationException e) {
        }
        try {
            proxy.removeContent(new EntityRef("a"));
            proxy.removeContent(new Comment(""));
            fail("Expected an UnsupportedOperationException");
        } catch (UnsupportedOperationException e) {
        }
        try {
            proxy.removeContent(new Comment(""));
            fail("Expected an UnsupportedOperationException");
        } catch (UnsupportedOperationException e) {
        }
    }
View Full Code Here

    public void writeDefaultNamespace(String namespace) throws XMLStreamException {
        currentNode.addNamespaceDeclaration(Namespace.getNamespace("", namespace));
    }

    public void writeComment(String value) throws XMLStreamException {
        currentNode.addContent(new Comment(value));
    }
View Full Code Here

    }
  }

  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

                    (ProcessingInstruction) ((ProcessingInstruction) value)
                        .clone();
                element.addContent(pi);
            }
            else if (value instanceof Comment) {
                Comment comment = (Comment) ((Comment) value).clone();
                element.addContent(comment);
            }
            else {
                String string = (String) TypeUtils.convert(value, String.class);
                if (string != null && !string.equals("")) {
View Full Code Here

        String comment = "DO NOT EDIT.  This file was generated by "
                + "ptolemy.domains.ptinyos.util.nc2moml.MoMLLib.  "
                + "The filename was chosen so that it does not "
                + "conflict with .nc files of the same name and any "
                + "other ptII-referenced .moml file in the classpath.";
        doc.addContent(new Comment(comment));
        doc.setRootElement(root);
        doc.setDocType(plot);

        Element group = new Element("group");
View Full Code Here

    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

TOP

Related Classes of org.jdom.Comment

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.