1 56 57 package org.jdom; 58 59 67 public class Comment extends Content { 68 69 private static final String CVS_ID = 70 "@(#) $RCSfile: Comment.java,v $ $Revision: 1.32 $ $Date: 2004/02/11 21:12:43 $ $Name: $"; 71 72 73 protected String text; 74 75 78 protected Comment() {} 79 80 85 public Comment(String text) { 86 setText(text); 87 } 88 89 90 96 public String getValue() { 97 return text; 98 } 99 100 105 public String getText() { 106 return text; 107 } 108 109 117 public Comment setText(String text) { 118 String reason; 119 if ((reason = Verifier.checkCommentData(text)) != null) { 120 throw new IllegalDataException(text, "comment", reason); 121 } 122 123 this.text = text; 124 return this; 125 } 126 127 137 public String toString() { 138 return new StringBuffer () 139 .append("[Comment: ") 140 .append(new org.jdom.output.XMLOutputter().outputString(this)) 141 .append("]") 142 .toString(); 143 } 144 145 } 146 | Popular Tags |