org.apache.directory.api.ldap.model.schema
Class PrepareString

java.lang.Object
  extended by org.apache.directory.api.ldap.model.schema.PrepareString

public final class PrepareString
extends Object

This class implements the 6 steps described in RFC 4518

Author:
Apache Directory Project

Nested Class Summary
static class PrepareString.StringType
          The type of String we have to normalize
 
Method Summary
static StringBuilder bidi(char[] array)
          Remove all bidirectionnal chars.
static String bidi(String str)
          Remove all bidirectionnal chars.
static String normalize(String str, PrepareString.StringType type)
          We have to go through 6 steps : 1) Transcode 2) Map 3) Normalize 4) Prohibit 5) Bidi 6) Insignifiant Character Handling The first step is already done, the step (3) is not done.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

normalize

public static String normalize(String str,
                               PrepareString.StringType type)
                        throws IOException
We have to go through 6 steps : 1) Transcode 2) Map 3) Normalize 4) Prohibit 5) Bidi 6) Insignifiant Character Handling The first step is already done, the step (3) is not done.

Parameters:
str - The String to normalize
type - The string type
Returns:
A normalized string.
Throws:
IOException

bidi

public static String bidi(String str)
Remove all bidirectionnal chars. This is not really clear in RFC 4518 what we should do with bidi chars : "Bidirectional characters are ignored." But it's not explained what is a bidi chars... So this method just do nothing atm.

Parameters:
str - The string where bidi chars are to be removed
Returns:
The cleaned string

bidi

public static StringBuilder bidi(char[] array)
Remove all bidirectionnal chars. This is not really clear in RFC 4518 what we should do with bidi chars : "Bidirectional characters are ignored." But it's not explained what is a bidi chars... So this method just do nothing atm.

Parameters:
array - The char array where bidi chars are to be removed
Returns:
The cleaned StringBuilder


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.