Package org.exoplatform.commons.utils
Class HTMLEntityEncoder
java.lang.Object
org.gatein.common.text.AbstractCharEncoder
org.gatein.common.text.EntityEncoder
org.exoplatform.commons.utils.HTMLEntityEncoder
- All Implemented Interfaces:
org.gatein.common.text.CharEncoder
public class HTMLEntityEncoder
extends org.gatein.common.text.EntityEncoder
This encoder provides a few methods to encode the String to its HTML entity representation.
- Version:
- $Revision$
- Author:
- Trong Tran
-
Field Summary
Fields inherited from class org.gatein.common.text.EntityEncoder
BASIC, FULL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionencodeHTML(String input) Encode data for use in HTMLencodeHTMLAttribute(String input) Encode data for use in HTML attributes.static HTMLEntityEncoderfinal StringlookupEntityName(char c) final StringlookupHexEntityNumber(char c) voidsafeEncode(char[] chars, int off, int len, org.gatein.common.text.CharWriter writer) Methods inherited from class org.gatein.common.text.EntityEncoder
encode, lookup, put, remove, reverseMethods inherited from class org.gatein.common.text.AbstractCharEncoder
encode, encode, encode, encode
-
Constructor Details
-
HTMLEntityEncoder
public HTMLEntityEncoder()
-
-
Method Details
-
getInstance
-
encodeHTML
Encode data for use in HTML- Parameters:
input- the string to encode for HTML- Returns:
- input encoded for HTML
-
encodeHTMLAttribute
Encode data for use in HTML attributes.- Parameters:
input- the string to encode for a HTML attribute- Returns:
- input encoded for use as value of a HTML attribute
-
safeEncode
public void safeEncode(char[] chars, int off, int len, org.gatein.common.text.CharWriter writer) throws org.gatein.common.text.EncodingException - Overrides:
safeEncodein classorg.gatein.common.text.EntityEncoder- Throws:
org.gatein.common.text.EncodingException
-
lookupEntityName
-
lookupHexEntityNumber
-