01: /*
02: * Enhydra Java Application Server Project
03: *
04: * The contents of this file are subject to the Enhydra Public License
05: * Version 1.1 (the "License"); you may not use this file except in
06: * compliance with the License. You may obtain a copy of the License on
07: * the Enhydra web site ( http://www.enhydra.org/ ).
08: *
09: * Software distributed under the License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11: * the License for the specific terms governing rights and limitations
12: * under the License.
13: *
14: * The Initial Developer of the Enhydra Application Server is Lutris
15: * Technologies, Inc. The Enhydra Application Server and portions created
16: * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17: * All Rights Reserved.
18: *
19: * Contributor(s):
20: *
21: * $Id: HtmlString.java,v 1.2 2006-06-15 13:47:00 sinisa Exp $
22: */
23:
24: package com.lutris.html;
25:
26: /**
27: * The <code>HtmlString</code> class contains a String and adds a
28: * toHtml() method. It is intended to be used in Jolt presentations
29: * and referenced through JoltFields. The presence of the toHtml()
30: * method prevents the default behavour of HTML encoding
31: * the string contents to take place.
32: *
33: * @author Paul Morgan
34: * @version 1.0 (File $Revision: 1.2 $)
35: * @since LBS1.8
36: */
37: public class HtmlString implements java.io.Serializable {
38: /** The contained string. */
39: private String value;
40:
41: /**
42: * Allocates a new string that contains the same sequence of
43: * characters as the string argument.
44: *
45: * @param value a <code>String</code>.
46: */
47: public HtmlString(String value) {
48: this .value = value;
49: }
50:
51: /**
52: * Allocates a new <code>String</code> that contains the same sequence
53: * characters contained in the string buffer argument.
54: *
55: * @param buffer a <code>StringBuffer</code>.
56: */
57: public HtmlString(StringBuffer buffer) {
58: this .value = buffer.toString();
59: }
60:
61: /**
62: * Returns the contained <code>String</code> object.
63: */
64: public String toString() {
65: return this .value;
66: }
67:
68: /**
69: * Returns the contained <code>String</code> object.
70: */
71: public String toHtml() {
72: return this.value;
73: }
74: }
|