org.jboss.dna.common.text
Class Jsr283Encoder

java.lang.Object
  extended by org.jboss.dna.common.text.Jsr283Encoder
All Implemented Interfaces:
TextEncoder

public class Jsr283Encoder
extends java.lang.Object
implements TextEncoder

Encoder that escapes characters that are not allowed in JCR names. The mapping defined in Section 3.6.3 of the JSR-283 public review document:

Non-JCR character
(Unicode code point)
Private use
Unicode code point
* (U+002A) U+F02A
/ (U+002F) U+F02F
: (U+003A) U+F03A
[ (U+005B) U+F05B
] (U+005D) U+F05D
| (U+007C) U+F07C

Author:
Randall Hauch

Constructor Summary
Jsr283Encoder()
           
 
Method Summary
 java.lang.String decode(java.lang.String jcrNodeName)
          Return the decoded version of an encoded string
 java.lang.String encode(java.lang.String publicName)
          Returns the encoded version of a string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Jsr283Encoder

public Jsr283Encoder()
Method Detail

encode

public java.lang.String encode(java.lang.String publicName)
Returns the encoded version of a string.

Specified by:
encode in interface TextEncoder
Parameters:
publicName - the text with characters that are to be encoded.
Returns:
the text with the characters encoded as required, or null if the supplied text is null
See Also:
TextEncoder.decode(String)

decode

public java.lang.String decode(java.lang.String jcrNodeName)
Return the decoded version of an encoded string

Specified by:
decode in interface TextEncoder
Parameters:
jcrNodeName - the encoded text
Returns:
the unecoded form of the text, or null if the supplied node name is also null
See Also:
TextEncoder.encode(String)


Copyright © 2008. All Rights Reserved.