org.springframework.web.util
Class HtmlCharacterEntityReferences

java.lang.Object
  extended by org.springframework.web.util.HtmlCharacterEntityReferences

 class HtmlCharacterEntityReferences
extends java.lang.Object

Represents a set of character entity references defined by the HTML 4.0 standard.

A complete description of the HTML 4.0 character set can be found at http://www.w3.org/TR/html4/charset.html.

Since:
1.2.1
Author:
Juergen Hoeller, Martin Kersten

Field Summary
(package private) static char CHAR_NULL
           
private  java.lang.String[] characterToEntityReferenceMap
           
(package private) static java.lang.String DECIMAL_REFERENCE_START
           
private  java.util.Map<java.lang.String,java.lang.Character> entityReferenceToCharacterMap
           
(package private) static java.lang.String HEX_REFERENCE_START
           
private static java.lang.String PROPERTIES_FILE
           
(package private) static char REFERENCE_END
           
(package private) static char REFERENCE_START
           
 
Constructor Summary
HtmlCharacterEntityReferences()
          Returns a new set of character entity references reflecting the HTML 4.0 character set.
 
Method Summary
 char convertToCharacter(java.lang.String entityReference)
          Return the char mapped to the given entityReference or -1.
 java.lang.String convertToReference(char character)
          Return the reference mapped to the given character or null.
 int getSupportedReferenceCount()
          Return the number of supported entity references.
 boolean isMappedToReference(char character)
          Return true if the given character is mapped to a supported entity reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTIES_FILE

private static final java.lang.String PROPERTIES_FILE
See Also:
Constant Field Values

REFERENCE_START

static final char REFERENCE_START
See Also:
Constant Field Values

DECIMAL_REFERENCE_START

static final java.lang.String DECIMAL_REFERENCE_START
See Also:
Constant Field Values

HEX_REFERENCE_START

static final java.lang.String HEX_REFERENCE_START
See Also:
Constant Field Values

REFERENCE_END

static final char REFERENCE_END
See Also:
Constant Field Values

CHAR_NULL

static final char CHAR_NULL
See Also:
Constant Field Values

characterToEntityReferenceMap

private final java.lang.String[] characterToEntityReferenceMap

entityReferenceToCharacterMap

private final java.util.Map<java.lang.String,java.lang.Character> entityReferenceToCharacterMap
Constructor Detail

HtmlCharacterEntityReferences

public HtmlCharacterEntityReferences()
Returns a new set of character entity references reflecting the HTML 4.0 character set.

Method Detail

getSupportedReferenceCount

public int getSupportedReferenceCount()
Return the number of supported entity references.


isMappedToReference

public boolean isMappedToReference(char character)
Return true if the given character is mapped to a supported entity reference.


convertToReference

public java.lang.String convertToReference(char character)
Return the reference mapped to the given character or null.


convertToCharacter

public char convertToCharacter(java.lang.String entityReference)
Return the char mapped to the given entityReference or -1.