|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgate.creole.ontology.OUtils
public class OUtils
| Field Summary | |
|---|---|
private static Pattern |
badPunctPattern
Pattern for symbol and punctuation characters that are not recommended in URIs. |
private static Pattern |
spacesPattern
Pattern matching runs of whitespace. |
| Constructor Summary | |
|---|---|
private |
OUtils()
Private constructor - this class should not be instantiated. |
| Method Summary | |
|---|---|
private static int |
hexDecode(byte b)
|
private static byte |
hexEncode(int i)
|
static String |
toResourceName(String text)
Converts a string to a form suitable for use as a resource name by the Ontology.createOURIForName(java.lang.String) method. |
static String |
uriDecode(String uri)
Convert a URI reference (URI or URI fragment), in US-ASCII, with escaped characters taken from UTF-8, to the corresponding Unicode string. |
static String |
uriEncode(String uriRef)
Convert a Unicode string (which is assumed to represent a URI or URI fragment) to an RFC 2396-compliant URI reference by first converting it to bytes in UTF-8 and then encoding the resulting bytes as specified by the RFC. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static Pattern badPunctPattern
private static Pattern spacesPattern
| Constructor Detail |
|---|
private OUtils()
| Method Detail |
|---|
public static String toResourceName(String text)
Ontology.createOURIForName(java.lang.String) method. This is not a reversible
encoding, but is intended to produce "readable" resource URIs in an
ontology from English source strings. The process is:
uriEncode(java.lang.String) the result.
public static String uriEncode(String uriRef)
uri - The uri, in characters specified by RFC 2396 + '#'
public static String uriDecode(String uri)
uri - The uri, in characters specified by RFC 2396 + '#'.
IllegalArgumentException - If a % hex sequence is ill-formed.private static final byte hexEncode(int i)
private static final int hexDecode(byte b)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||