Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/lutris/html/HtmlString.java


1   /*
2    * Enhydra Java Application Server Project
3    * 
4    * The contents of this file are subject to the Enhydra Public License
5    * Version 1.1 (the "License"); you may not use this file except in
6    * compliance with the License. You may obtain a copy of the License on
7    * the Enhydra web site ( http://www.enhydra.org/ ).
8    * 
9    * 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.7.12.1 2000/10/19 17:58:53 jasona Exp $
22   */
23  
24  
25  
26  
27  
28  package com.lutris.html;
29  
30  import java.lang.String;
31  import java.lang.StringBuffer;
32  
33  /**
34   * The <code>HtmlString</code> class contains a String and adds a
35   * toHtml() method. It is intended to be used in Jolt presentations
36   * and referenced through JoltFields. The presence of the toHtml()
37   * method prevents the default behavour of HTML encoding
38   * the string contents to take place.
39   *
40   * @author  Paul Morgan
41   * @version 1.0 (File $Revision: 1.7.12.1 $)
42   * @since   LBS1.8
43   */
44  public
45  class HtmlString implements java.io.Serializable {
46      /** The contained string. */
47      private String value;
48  
49      /**
50       * Allocates a new string that contains the same sequence of 
51       * characters as the string argument. 
52       *
53       * @param   value   a <code>String</code>.
54       */
55      public HtmlString(String value) {
56    this.value = value;
57      }
58  
59      /**
60       * Allocates a new <code>String</code> that contains the same sequence
61       * characters contained in the string buffer argument. 
62       *
63       * @param   buffer   a <code>StringBuffer</code>.
64       */
65      public HtmlString(StringBuffer buffer) {
66    this.value = buffer.toString();
67      }
68  
69      /**
70       * Returns the contained <code>String</code> object.
71       */
72      public String toString() {
73    return this.value;
74      }
75  
76      /**
77       * Returns the contained <code>String</code> object.
78       */
79      public String toHtml() {
80    return this.value;
81      }
82  }