Package gnu.inet.encoding
Class Stringprep
java.lang.Object
gnu.inet.encoding.Stringprep
This class offers static methods for preparing internationalized strings. It supports the following stringprep
profiles:
- RFC3491 nameprep
- RFC3920 XMPP nodeprep and resourceprep
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Preps a name according to the Stringprep profile defined in RFC3491.static String
Preps a name according to the Stringprep profile defined in RFC3491.static String
Preps a node name according to the Stringprep profile defined in RFC3920.static String
Preps a node name according to the Stringprep profile defined in RFC3920.static String
resourceprep
(String input) Preps a resource name according to the Stringprep profile defined in RFC3920.static String
resourceprep
(String input, boolean allowUnassigned) Preps a resource name according to the Stringprep profile defined in RFC3920.
-
Constructor Details
-
Stringprep
public Stringprep()
-
-
Method Details
-
nameprep
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.NullPointerException
- If the name is null.
-
nameprep
public static String nameprep(String input, boolean allowUnassigned) throws StringprepException, 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.NullPointerException
- If the name is null.
-
nodeprep
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.NullPointerException
- If the node name is null.
-
nodeprep
public static String nodeprep(String input, boolean allowUnassigned) throws StringprepException, 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.NullPointerException
- If the node name is null.
-
resourceprep
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.NullPointerException
- If the resource name is null.
-
resourceprep
public static String resourceprep(String input, boolean allowUnassigned) throws StringprepException, 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.NullPointerException
- If the resource name is null.
-