com.google.clearsilver.jsilver.functions.escape
Class HtmlEscapeFunction

java.lang.Object
  extended by com.google.clearsilver.jsilver.functions.escape.SimpleEscapingFunction
      extended by com.google.clearsilver.jsilver.functions.escape.HtmlEscapeFunction
All Implemented Interfaces:
TextFilter

public class HtmlEscapeFunction
extends SimpleEscapingFunction

This class HTML escapes a string in the same way as the ClearSilver html_escape function. This implementation has been optimized for performance.


Constructor Summary
HtmlEscapeFunction(boolean isUnquoted)
          isUnquoted should be true if the function is escaping a string that will appear inside an unquoted HTML attribute.
 
Method Summary
protected  String getEscapeString(char c)
          Given one of the escape characters supplied to this instance's constructor, return the escape string for it.
 
Methods inherited from class com.google.clearsilver.jsilver.functions.escape.SimpleEscapingFunction
filter, setEscapeChars
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlEscapeFunction

public HtmlEscapeFunction(boolean isUnquoted)
isUnquoted should be true if the function is escaping a string that will appear inside an unquoted HTML attribute. If the string is unquoted, we strip out all characters 0 - 0x1f and 0x7f for security reasons.

Method Detail

getEscapeString

protected String getEscapeString(char c)
Description copied from class: SimpleEscapingFunction
Given one of the escape characters supplied to this instance's constructor, return the escape string for it. This method does not need to be efficient.

Specified by:
getEscapeString in class SimpleEscapingFunction


Copyright © 2010-2012 Google. All Rights Reserved.