KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > vladium > emma > report > html > doc > Text


1 /* Copyright (C) 2003 Vladimir Roubtsov. All rights reserved.
2  *
3  * This program and the accompanying materials are made available under
4  * the terms of the Common Public License v1.0 which accompanies this distribution,
5  * and is available at http://www.eclipse.org/legal/cpl-v10.html
6  *
7  * $Id: Text.java,v 1.1.1.1 2004/05/09 16:57:42 vlad_r Exp $
8  */

9 package com.vladium.emma.report.html.doc;
10
11 import com.vladium.util.Strings;
12
13 // ----------------------------------------------------------------------------
14
/**
15  * @author Vlad Roubtsov, (C) 2003
16  */

17 public
18 final class Text implements IContent
19 {
20     // public: ................................................................
21

22     public Text (final String JavaDoc text, final boolean nbsp)
23     {
24         m_text = text;
25         m_nbsp = nbsp;
26     }
27     
28     public void emit (final HTMLWriter out)
29     {
30         if (m_text != null)
31         {
32             if (m_nbsp)
33                 out.write (Strings.HTMLEscapeSP (m_text));
34             else
35                 out.write (Strings.HTMLEscape (m_text));
36         }
37     }
38     
39     // protected: .............................................................
40

41     // package: ...............................................................
42

43     // private: ...............................................................
44

45     
46     private final String JavaDoc m_text;
47     private final boolean m_nbsp;
48
49 } // end of class
50
// ----------------------------------------------------------------------------
Popular Tags