Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.modeshape.common.text
Class Jsr283Encoder

    java.lang.Object
      org.modeshape.common.text.Jsr283Encoder

All Implemented Interfaces:
  TextDecoder, TextEncoder

    @Immutable
    public class Jsr283Encoder

extends Object
implements TextEncoder, TextDecoder

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

Constructor Summary
`Jsr283Encoder()`

Method Summary
`static boolean` | `containsEncodeableCharacters(String str)`
`String` | `decode(String jcrNodeName)` Return the decoded version of an encoded string
`String` | `encode(String publicName)` 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

### Jsr283Encoder

    public Jsr283Encoder()

Method Detail

### containsEncodeableCharacters

    public static boolean containsEncodeableCharacters(String str)

### encode

    public String encode(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:
    `TextDecoder.decode(String)`

### decode

    public String decode(String jcrNodeName)

  Return the decoded version of an encoded string

  Specified by:
    `decode` in interface `TextDecoder`
  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)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.