eworks.RDF.util
Class UriFactory
java.lang.Object
eworks.RDF.util.UriFactory
- public class UriFactory
- extends Object
UriFactory
provides a factory for instances of the class
java.net.URI
. This class is a helper class for minimizing an
application's need for memory, by ensuring that identical URIs are
represented by the same java.net.URI
-instance.
try {
URI myUriInstance = UriFactory.getURI("http://www.foobar.org");
URI identicalUriInstance = UriFactory.getURI("http://www.foobar.org");
} catch(URISyntaxException e) {
System.out.println(e);
}
- Version:
- 1.00 (2003-11-03)
- Author:
- Fabian Wleklinski (fabian@wleklinski.de)
Method Summary |
static URI |
getURI(String literal)
Returns as instance of java.net.URI for the given URI literal. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getURI
public static URI getURI(String literal)
throws URISyntaxException
- Returns as instance of
java.net.URI
for the given URI literal.
- Parameters:
literal
- The URI's string representation, example given
http://www.foobar.org
- Returns:
- A cached instance of
java.net.URI
if avilable, a new
instance otherwise.
- Throws:
URISyntaxException
- if the given literal
is no valid URI.