|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.common.text.XmlNameEncoder
@Immutable public class XmlNameEncoder
An encoder
and decoder
for XML element and attribute names.
Any UTF-16 unicode character that is not a valid XML name character according to the World Wide Web Consortium (W3C) Extensible Markup Language (XML) 1.0
(Fourth Edition) Recommendation is escaped as _xHHHH_
, where HHHH
stands for the four-digit
hexadecimal UTF-16 unicode value for the character in the most significant bit first order. For example, the name "Customer_ID"
is encoded as "Customer_x0020_ID".
Decoding transforms every _xHHHH_
encoding sequences back into the UTF-16 character. Note that
decoding
can be safely done on any XML name, even if the name does not contain any encoded sequences.
Constructor Summary | |
---|---|
XmlNameEncoder()
|
Method Summary | |
---|---|
String |
decode(String encodedText)
Return the decoded version of an encoded string |
String |
encode(String text)
Returns the encoded version of a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlNameEncoder()
Method Detail |
---|
public String decode(String encodedText)
decode
in interface TextDecoder
encodedText
- the encoded text
TextDecoder.decode(java.lang.String)
public String encode(String text)
encode
in interface TextEncoder
text
- the text with characters that are to be encoded.
TextEncoder.encode(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |