org.springframework.web.util
Class HtmlCharacterEntityDecoder

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

 class HtmlCharacterEntityDecoder
extends java.lang.Object

Helper for decoding HTML Strings by replacing character entity references with the referred character.

Since:
1.2.1
Author:
Juergen Hoeller, Martin Kersten

Field Summary
private  HtmlCharacterEntityReferences characterEntityReferences
           
private  int currentPosition
           
private  java.lang.StringBuilder decodedMessage
           
private static int MAX_REFERENCE_SIZE
           
private  int nextPotentialReferencePosition
           
private  int nextSemicolonPosition
           
private  java.lang.String originalMessage
           
 
Constructor Summary
HtmlCharacterEntityDecoder(HtmlCharacterEntityReferences characterEntityReferences, java.lang.String original)
           
 
Method Summary
private  void copyCharactersTillPotentialReference()
           
 java.lang.String decode()
           
private  void findNextPotentialReference(int startPosition)
           
private  java.lang.String getReferenceSubstring(int referenceOffset)
           
private  boolean processNamedReference()
           
private  boolean processNumberedReference()
           
private  void processPossibleReference()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_REFERENCE_SIZE

private static final int MAX_REFERENCE_SIZE
See Also:
Constant Field Values

characterEntityReferences

private final HtmlCharacterEntityReferences characterEntityReferences

originalMessage

private final java.lang.String originalMessage

decodedMessage

private final java.lang.StringBuilder decodedMessage

currentPosition

private int currentPosition

nextPotentialReferencePosition

private int nextPotentialReferencePosition

nextSemicolonPosition

private int nextSemicolonPosition
Constructor Detail

HtmlCharacterEntityDecoder

public HtmlCharacterEntityDecoder(HtmlCharacterEntityReferences characterEntityReferences,
                                  java.lang.String original)
Method Detail

decode

public java.lang.String decode()

findNextPotentialReference

private void findNextPotentialReference(int startPosition)

copyCharactersTillPotentialReference

private void copyCharactersTillPotentialReference()

processPossibleReference

private void processPossibleReference()

processNumberedReference

private boolean processNumberedReference()

processNamedReference

private boolean processNamedReference()

getReferenceSubstring

private java.lang.String getReferenceSubstring(int referenceOffset)