/*
* Enhydra Java Application Server Project
*
* The contents of this file are subject to the Enhydra Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License on
* the Enhydra web site ( http://www.enhydra.org/ ).
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific terms governing rights and limitations
* under the License.
*
* The Initial Developer of the Enhydra Application Server is Lutris
* Technologies, Inc. The Enhydra Application Server and portions created
* by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
* All Rights Reserved.
*
* Contributor(s):
*
* $Id: HtmlString.java,v 1.2 2006-06-15 13:47:00 sinisa Exp $
*/
package com.lutris.html;
/**
* The <code>HtmlString</code> class contains a String and adds a
* toHtml() method. It is intended to be used in Jolt presentations
* and referenced through JoltFields. The presence of the toHtml()
* method prevents the default behavour of HTML encoding
* the string contents to take place.
*
* @author Paul Morgan
* @version 1.0 (File $Revision: 1.2 $)
* @since LBS1.8
*/
public
class HtmlString implements java.io.Serializable {
/** The contained string. */
private String value;
/**
* Allocates a new string that contains the same sequence of
* characters as the string argument.
*
* @param value a <code>String</code>.
*/
public HtmlString(String value) {
this.value = value;
}
/**
* Allocates a new <code>String</code> that contains the same sequence
* characters contained in the string buffer argument.
*
* @param buffer a <code>StringBuffer</code>.
*/
public HtmlString(StringBuffer buffer) {
this.value = buffer.toString();
}
/**
* Returns the contained <code>String</code> object.
*/
public String toString() {
return this.value;
}
/**
* Returns the contained <code>String</code> object.
*/
public String toHtml() {
return this.value;
}
}
|