Package org.jdom

Examples of org.jdom.Comment


    public void writeCData(String text) throws IOException {
        this.currentElement.addContent(new CDATA(text));
    }

    public void writeComment(String text) throws IOException {
        this.currentElement.addContent(new Comment(text));
    }
View Full Code Here


  protected void init() {
    Document _model;
    Element root = new Element(ROOT_NODE_NAME);
    _model = new Document(root);
    for (int i = 0; i < scorm_comments.length; i++) {
      Comment comment = new Comment(scorm_comments[i]);
      _model.getContent().add(0, comment);
    }
    this.setDocument(_model);
  }
View Full Code Here

        Element childrenInteractionsCount = new Element("_count");
        childrenInteractionsCount.setText("0");
        interactions.addContent(childrenInteractionsCount);

        for(int i = 0; i < scorm_comments.length; i++) {
             Comment comment = new Comment(scorm_comments[i]);
             _model.getContent().add(0, comment);
        }       
    }
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

    }
    if (n.getConstructorType() == Factory.Node_charData) {
      return new Text(text);
    }
    if (n.getConstructorType() == Factory.Node_comment) {
      return new Comment(text);
    }
   
    wellformednessError();
    return null;
  }
View Full Code Here

    if (content instanceof Text) {
      Text text = (Text)content;
      return vf.constructor(Factory.Node_charData, getString(trim, text));
    }
    if (content instanceof Comment) {
      Comment comment = (Comment)content;
      IString data = vf.string(comment.getText());
      return vf.constructor(Factory.Node_comment, data);
    }
    if (content instanceof ProcessingInstruction) {
      ProcessingInstruction pi = (ProcessingInstruction)content;
      IString data = vf.string(pi.getData());
View Full Code Here

                    text = att.getValue().trim();
                } else if (obj instanceof Text) {
                    Text txt = (Text) obj;
                    text = txt.getText().trim();
                } else if (obj instanceof Comment) {
                    Comment com = (Comment) obj;
                    text = com.getText().trim();
                } else if (obj instanceof ProcessingInstruction) {
                    ProcessingInstruction pi = (ProcessingInstruction) obj;
                    text = pi.getData().trim();
                } else if (obj instanceof EntityRef) {
                    EntityRef er = (EntityRef) obj;
View Full Code Here

                    metadata.add(name, att.getValue());
                } else if (node instanceof Text) {
                    Text text = (Text) node;
                    metadata.add(name, text.getText());
                } else if (node instanceof Comment) {
                    Comment com = (Comment) node;
                    metadata.add(name, com.getText());
                } else if (node instanceof ProcessingInstruction) {
                    ProcessingInstruction pi = (ProcessingInstruction) node;
                    metadata.add(name, pi.getData());
                } else if (node instanceof EntityRef) {
                    EntityRef er = (EntityRef) node;
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

  }

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