FileDocCategorySizeDatePackage
HTMLComment.javaAPI DocGlassfish v2 API3445Fri May 04 22:34:48 BST 2007com.sun.enterprise.diagnostics.report.html

HTMLComment

public class HTMLComment extends Object implements Text
Provide a basic implementation of a comment.

Fields Summary
private String
text
The text of the comment.
private static String
COMMENT_BEGIN
private static String
COMMENT_END
Constructors Summary
public HTMLComment(String text)
Create a new comment.

param
text The text of the comment.

    
          	         
       
        setValue(text);
    
Methods Summary
public java.lang.StringgetValue()

        return text;
    
public voidsetValue(java.lang.String text)

        if (text == null) {
            throw new NullPointerException("Comment text is null.");
        }
        this.text = text;
    
public java.lang.StringtoString()

see
java.lang.Object#toString()

        StringBuffer buf = new StringBuffer();
        buf.append(COMMENT_BEGIN)
        	.append(Escape.getInstance().encodeEntities(text, ""))
        	.append(COMMENT_END);
        return buf.toString();
    
public voidwrite(java.io.Writer output)

        output.append(toString());
        output.flush();
    
public voidwrite(java.io.File file)

        FileWriter fw = new FileWriter(file);
        write(fw);
        fw.close();