/**
 * Licensed under the MICE s.r.l.
 * End User License Agreement
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.micegroup.it/voila/license.html
 */
package it.mice.voila.runtime.displaytag.basedec;

import javax.servlet.jsp.PageContext;

import org.apache.commons.lang.StringEscapeUtils;

/**
 * Display Column Decorator per la trasformazione delle date anche con l'ora.
 *
 */
public class EscapeHtmlDecorator extends TextareaToHtmlParagraphDecorator {
	protected PageContext pageContext = null;

    public EscapeHtmlDecorator() {
        super();
    }

	/**
	 * Called after the object has been retrieved from the bean contained in the list and
	 * before the decorate method will executed.
	 * 
	 * @param pageContext
	 *            Column instance object that allow you to surf the entire model of
	 *            displaytag
	 */
	public void setPageContext(PageContext pageContext) {
		this.pageContext = pageContext;
	}

	public String decorate(Object value) {
    	if (value == null) {
    		return "";
    	}
    	return super.decorate(StringEscapeUtils.escapeHtml(value.toString()));
    }

}
