org.apache.tapestry.util.text
Class XmlCharacterTranslator

java.lang.Object
  extended by org.apache.tapestry.util.text.MarkupCharacterTranslator
      extended by org.apache.tapestry.util.text.XmlCharacterTranslator
All Implemented Interfaces:
ICharacterTranslator

public final class XmlCharacterTranslator
extends MarkupCharacterTranslator

Handles escaping of special characters as per the XML spec section 2.2.

Author:
lquijano

Constructor Summary
XmlCharacterTranslator()
          Default constructor.
 
Method Summary
 String translate(char ch)
          Translates the character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlCharacterTranslator

public XmlCharacterTranslator()
Default constructor.

Method Detail

translate

public String translate(char ch)
Translates the character.

XML spec section 2.2 Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.

Specified by:
translate in interface ICharacterTranslator
Overrides:
translate in class MarkupCharacterTranslator
Parameters:
ch - the character to be translated
Returns:
null if the character is not to be translated, an empty string if the character is to be ignored, or another string to represent the character translation
See Also:
ICharacterTranslator.translate(char)


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.