org.jboss.portal.common.text
Class EntityEncoder
java.lang.Object
org.jboss.portal.common.text.AbstractCharEncoder
org.jboss.portal.common.text.EntityEncoder
- All Implemented Interfaces:
- CharEncoder
public class EntityEncoder
- extends AbstractCharEncoder
This encoder performs lookup for converting a char to its HTML entity representation.
- Version:
- $Revision: 630 $
- Author:
- Julien Viet
Method Summary |
java.lang.String |
lookup(char c)
Returns null if no entity is found or return the converted entity. |
protected void |
put(int c,
java.lang.String entity)
|
protected void |
remove(int c)
|
void |
safeEncode(char[] chars,
int off,
int len,
CharWriter writer)
|
void |
safeEncode(char c,
CharWriter writer)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FULL
public static final EntityEncoder FULL
- All HTML entities.
BASIC
public static final EntityEncoder BASIC
- All HTML entities except the HTML chars which are used to do HTML itself.
EntityEncoder
protected EntityEncoder()
safeEncode
public void safeEncode(char c,
CharWriter writer)
throws EncodingException
- Throws:
EncodingException
safeEncode
public void safeEncode(char[] chars,
int off,
int len,
CharWriter writer)
throws EncodingException
- Specified by:
safeEncode
in class AbstractCharEncoder
- Throws:
EncodingException
put
protected final void put(int c,
java.lang.String entity)
remove
protected final void remove(int c)
lookup
public final java.lang.String lookup(char c)
- Returns null if no entity is found or return the converted entity.
- Parameters:
c
- the char to encode
- Returns:
- the corresponding encoded string or null