Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Field Summary
`static EntityEncoder` | `BASIC` All HTML entities except the HTML chars which are used to do HTML itself.
`static EntityEncoder` | `FULL` All HTML entities.

Constructor Summary
`protected` | `EntityEncoder()`

Method Summary
`void` | `encode(char c, CharWriter writer)`
`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)`

Methods inherited from class org.jboss.portal.common.text.AbstractCharEncoder
`encode, encode, encode, encode`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### 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.

Constructor Detail

### EntityEncoder

    protected EntityEncoder()

Method Detail

### encode

    public void encode(char c,
                       CharWriter writer)
                throws EncodingException

  Specified by:
    `encode` in interface `CharEncoder`
  Overrides:
    `encode` in class `AbstractCharEncoder`
  Parameters:
    `c` - the char to encode
    `writer` - the writer to use
  Throws:
    `EncodingException` - an encoding exception

### 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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008. All Rights Reserved.