gnu.inet.encoding
Class Stringprep

java.lang.Object
  extended by gnu.inet.encoding.Stringprep

public class Stringprep
extends java.lang.Object

This class offers static methods for preparing internationalized strings. It supports the following stringprep profiles:

Note that this implementation only supports 16-bit Unicode code points.


Constructor Summary
Stringprep()
           
 
Method Summary
static java.lang.String nameprep(java.lang.String input)
          Preps a name according to the Stringprep profile defined in RFC3491.
static java.lang.String nameprep(java.lang.String input, boolean allowUnassigned)
          Preps a name according to the Stringprep profile defined in RFC3491.
static java.lang.String nodeprep(java.lang.String input)
          Preps a node name according to the Stringprep profile defined in RFC3920.
static java.lang.String nodeprep(java.lang.String input, boolean allowUnassigned)
          Preps a node name according to the Stringprep profile defined in RFC3920.
static java.lang.String resourceprep(java.lang.String input)
          Preps a resource name according to the Stringprep profile defined in RFC3920.
static java.lang.String resourceprep(java.lang.String input, boolean allowUnassigned)
          Preps a resource name according to the Stringprep profile defined in RFC3920.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stringprep

public Stringprep()
Method Detail

nameprep

public static java.lang.String nameprep(java.lang.String input)
                                 throws StringprepException,
                                        java.lang.NullPointerException
Preps a name according to the Stringprep profile defined in RFC3491. Unassigned code points are not allowed.

Parameters:
input - the name to prep.
Returns:
the prepped name.
Throws:
StringprepException - If the name cannot be prepped with this profile.
java.lang.NullPointerException - If the name is null.

nameprep

public static java.lang.String nameprep(java.lang.String input,
                                        boolean allowUnassigned)
                                 throws StringprepException,
                                        java.lang.NullPointerException
Preps a name according to the Stringprep profile defined in RFC3491.

Parameters:
input - the name to prep.
allowUnassigned - true if the name may contain unassigned code points.
Returns:
the prepped name.
Throws:
StringprepException - If the name cannot be prepped with this profile.
java.lang.NullPointerException - If the name is null.

nodeprep

public static java.lang.String nodeprep(java.lang.String input)
                                 throws StringprepException,
                                        java.lang.NullPointerException
Preps a node name according to the Stringprep profile defined in RFC3920. Unassigned code points are not allowed.

Parameters:
input - the node name to prep.
Returns:
the prepped node name.
Throws:
StringprepException - If the node name cannot be prepped with this profile.
java.lang.NullPointerException - If the node name is null.

nodeprep

public static java.lang.String nodeprep(java.lang.String input,
                                        boolean allowUnassigned)
                                 throws StringprepException,
                                        java.lang.NullPointerException
Preps a node name according to the Stringprep profile defined in RFC3920.

Parameters:
input - the node name to prep.
allowUnassigned - true if the node name may contain unassigned code points.
Returns:
the prepped node name.
Throws:
StringprepException - If the node name cannot be prepped with this profile.
java.lang.NullPointerException - If the node name is null.

resourceprep

public static java.lang.String resourceprep(java.lang.String input)
                                     throws StringprepException,
                                            java.lang.NullPointerException
Preps a resource name according to the Stringprep profile defined in RFC3920. Unassigned code points are not allowed.

Parameters:
input - the resource name to prep.
Returns:
the prepped node name.
Throws:
StringprepException - If the resource name cannot be prepped with this profile.
java.lang.NullPointerException - If the resource name is null.

resourceprep

public static java.lang.String resourceprep(java.lang.String input,
                                            boolean allowUnassigned)
                                     throws StringprepException,
                                            java.lang.NullPointerException
Preps a resource name according to the Stringprep profile defined in RFC3920.

Parameters:
input - the resource name to prep.
allowUnassigned - true if the resource name may contain unassigned code points.
Returns:
the prepped node name.
Throws:
StringprepException - If the resource name cannot be prepped with this profile.
java.lang.NullPointerException - If the resource name is null.


Copyright © 2010 Tigase. All Rights Reserved.