Top Description Fields Constructors Methods
org.springframework.web.util

pack-priv Class HtmlCharacterEntityReferences

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, java.util.Enumeration, .HashMap, .Map, .Properties, org.springframework.lang.Nullable, org.springframework.util.Assert

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 https://www.w3.org/TR/html4/charset.html.

Authors
Juergen Hoeller, Martin Kersten, Craig Andrews
Since
1.2.1

Field Summary

Modifier and TypeField and Description
pack-priv static final char
private final String[]
pack-priv static final String
private final Map<String, Character>
pack-priv static final String
private static final String
pack-priv static final char
pack-priv static final char

Constructor Summary

AccessConstructor and Description
public
HtmlCharacterEntityReferences()

Returns a new set of character entity references reflecting the HTML 4.0 character set.

Method Summary

Modifier and TypeMethod and Description
public char
convertToCharacter(String entityReference)

Return the char mapped to the given entityReference or -1.

public String
convertToReference(char character)

Return the reference mapped to the given character, or null if none found.

public String
convertToReference(char character, String encoding)

Return the reference mapped to the given character, or null if none found.

public int
getSupportedReferenceCount()

Return the number of supported entity references.

public boolean
isMappedToReference(char character)

Return true if the given character is mapped to a supported entity reference.

public boolean
isMappedToReference(char character, String encoding)

Return true if the given character is mapped to a supported entity reference.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CHAR_NULLback to summary
pack-priv static final char CHAR_NULL
characterToEntityReferenceMapback to summary
private final String[] characterToEntityReferenceMap
DECIMAL_REFERENCE_STARTback to summary
pack-priv static final String DECIMAL_REFERENCE_START
entityReferenceToCharacterMapback to summary
private final Map<String, Character> entityReferenceToCharacterMap
HEX_REFERENCE_STARTback to summary
pack-priv static final String HEX_REFERENCE_START
PROPERTIES_FILEback to summary
private static final String PROPERTIES_FILE
REFERENCE_ENDback to summary
pack-priv static final char REFERENCE_END
REFERENCE_STARTback to summary
pack-priv static final char REFERENCE_START

Constructor Detail

HtmlCharacterEntityReferencesback to summary
public HtmlCharacterEntityReferences()

Returns a new set of character entity references reflecting the HTML 4.0 character set.

Method Detail

convertToCharacterback to summary
public char convertToCharacter(String entityReference)

Return the char mapped to the given entityReference or -1.

convertToReferenceback to summary
public String convertToReference(char character)

Return the reference mapped to the given character, or null if none found.

Annotations
@Nullable
convertToReferenceback to summary
public String convertToReference(char character, String encoding)

Return the reference mapped to the given character, or null if none found.

Annotations
@Nullable
Since
4.1.2
getSupportedReferenceCountback to summary
public int getSupportedReferenceCount()

Return the number of supported entity references.

isMappedToReferenceback to summary
public boolean isMappedToReference(char character)

Return true if the given character is mapped to a supported entity reference.

isMappedToReferenceback to summary
public boolean isMappedToReference(char character, String encoding)

Return true if the given character is mapped to a supported entity reference.