public final class URN extends Object implements Serializable
| Constructor and Description |
|---|
URN(String urn)
Creates a new
URN by parsing the given String as
specified by the grammar in RFC 2141. |
URN(String nid,
String nss)
Creates a new
URN with the specified Namespace Identifier and
Namespace Specific String. |
URN(String scheme,
String nid,
String nss)
Creates a new
URN with the specified scheme, Namespace
Identifier and Namespace Specific String. |
| Modifier and Type | Method and Description |
|---|---|
static URN |
create(String urn)
Creates a new
URN by parsing the given String. |
boolean |
equals(Object o) |
int |
hashCode() |
String |
nid()
Returns the Namespace Identifier part of this
URN. |
URN |
normalized()
Returns the normalized equivalent of this
URN. |
String |
nss()
Returns the Namespace Specific String of this
URN. |
String |
scheme()
Returns the scheme part of this
URN, namely it returns "urn"
modulo the case. |
String |
toString() |
URI |
toURI()
Returns the
URI equivalent to this URN. |
public URN(String urn) throws URNSyntaxException
URN by parsing the given String as
specified by the grammar in RFC 2141.urn - the String to be parsed into a URN.NullPointerException - if urn is null.URNSyntaxException - if urn violates RFC 2141.public URN(String nid, String nss) throws URNSyntaxException
URN with the specified Namespace Identifier and
Namespace Specific String.nid - the Namespace Identifier.nss - the Namespace Specific String.NullPointerException - if one of the arguments is null.URNSyntaxException - if the URN constructed from the
given components violates RFC 2141.public URN(String scheme, String nid, String nss) throws URNSyntaxException
URN with the specified scheme, Namespace
Identifier and Namespace Specific String.scheme - the scheme, must be equal to "urn", ignoring the case.nid - the Namespace Identifier.nss - the Namespace Specific String.NullPointerException - if one of the arguments is null.URNSyntaxException - if the URN constructed from the
given components violates RFC 2141.public static URN create(String urn)
URN by parsing the given String. This
function invokes the URN(java.lang.String) constructor;
any URNSyntaxException thrown by the constructor is caught
and wrapped in a new IllegalArgumentException, which is then
thrown. This method is provided for use in situations where it is
known that the given String is a legal URN.urn - the String to be parsed into a URN.URN.NullPointerException - if urn is null.IllegalArgumentException - if urn violates RFC 2141.public String scheme()
URN, namely it returns "urn"
modulo the case.URN's scheme.public String nid()
URN.URN's NID.public String nss()
URN.URN's NSS.public URN normalized()
URN. Normalizing a
URN consists in lower-casing its scheme, NID and percent
encoded parts.URN.public URI toURI()
URI equivalent to this URN.URI equivalent to this URN.Copyright © 2012–2015. All rights reserved.