net.sf.okapi.common

## Class HTMLCharacterEntities

- java.lang.Object
- - net.sf.okapi.common.HTMLCharacterEntities

-     public class HTMLCharacterEntities
      extends java.lang.Object

  Helper class to handle HTML character entities.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HTMLCharacterEntities()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `ensureInitialization(boolean includeSpecialChars)` Ensures the lookup table is initialized.
    `java.lang.String` | `getName(char value)` Gets the entity name for the given character.
    `int` | `lookupName(java.lang.String name)` Gets the character for a given entity name (e.g.
    `int` | `lookupReference(java.lang.String ref)` Gets the character for a given character entity reference (e.g.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HTMLCharacterEntities

          public HTMLCharacterEntities()

  - ### Method Detail

    - #### ensureInitialization

          public void ensureInitialization(boolean includeSpecialChars)

      Ensures the lookup table is initialized. You must call this method before using others.
      Parameters:
        `includeSpecialChars` - true if XML-pre-defined entities should be included in the list of supported entities.

    - #### lookupReference

          public int lookupReference(java.lang.String ref)

      Gets the character for a given character entity reference (e.g. "á").
      Parameters:
        `ref` - the reference to lookup.
      Returns:
        the unicode value for the given reference, or -1 if it was not found.

    - #### lookupName

          public int lookupName(java.lang.String name)

      Gets the character for a given entity name (e.g. "aacute").
      Parameters:
        `name` - the name to lookup.
      Returns:
        the unicode value for the given name, or -1 if it was not found.

    - #### getName

          public java.lang.String getName(char value)

      Gets the entity name for the given character.
      Parameters:
        `value` - the character to lookup.
      Returns:
        the name for the given character, or null if it was not found.