KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lutris > html > HtmlString


1
2 /*
3  * Enhydra Java Application Server Project
4  *
5  * The contents of this file are subject to the Enhydra Public License
6  * Version 1.1 (the "License"); you may not use this file except in
7  * compliance with the License. You may obtain a copy of the License on
8  * the Enhydra web site ( http://www.enhydra.org/ ).
9  *
10  * Software distributed under the License is distributed on an "AS IS"
11  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
12  * the License for the specific terms governing rights and limitations
13  * under the License.
14  *
15  * The Initial Developer of the Enhydra Application Server is Lutris
16  * Technologies, Inc. The Enhydra Application Server and portions created
17  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
18  * All Rights Reserved.
19  *
20  * Contributor(s):
21  *
22  * $Id: HtmlString.java,v 1.2 2005/03/24 10:51:20 slobodan Exp $
23  */

24
25
26
27
28
29 package com.lutris.html;
30
31
32 /**
33  * The <code>HtmlString</code> class contains a String and adds a
34  * toHtml() method. It is intended to be used in Jolt presentations
35  * and referenced through JoltFields. The presence of the toHtml()
36  * method prevents the default behavour of HTML encoding
37  * the string contents to take place.
38  *
39  * @author Paul Morgan
40  * @version 1.0 (File $Revision: 1.2 $)
41  * @since LBS1.8
42  */

43 public
44 class HtmlString implements java.io.Serializable JavaDoc {
45     /** The contained string. */
46     private String JavaDoc value;
47
48     /**
49      * Allocates a new string that contains the same sequence of
50      * characters as the string argument.
51      *
52      * @param value a <code>String</code>.
53      */

54     public HtmlString(String JavaDoc value) {
55     this.value = value;
56     }
57
58     /**
59      * Allocates a new <code>String</code> that contains the same sequence
60      * characters contained in the string buffer argument.
61      *
62      * @param buffer a <code>StringBuffer</code>.
63      */

64     public HtmlString(StringBuffer JavaDoc buffer) {
65     this.value = buffer.toString();
66     }
67
68     /**
69      * Returns the contained <code>String</code> object.
70      */

71     public String JavaDoc toString() {
72     return this.value;
73     }
74
75     /**
76      * Returns the contained <code>String</code> object.
77      */

78     public String JavaDoc toHtml() {
79     return this.value;
80     }
81 }
82
Popular Tags