public class NamespaceKey extends java.lang.Object implements java.lang.Comparable<NamespaceKey>
Constructor and Description |
---|
NamespaceKey(java.lang.String name)
Constructor with a null URI.
|
NamespaceKey(java.lang.String uri,
java.lang.String name)
Constructor.
|
NamespaceKey(java.net.URI uri,
java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(NamespaceKey o) |
static NamespaceKey |
createKey(java.lang.String name)
Create a key without a URI.
|
static NamespaceKey |
createKey(java.lang.String uri,
java.lang.String name)
Create a key from an URI expressed as a String and a name.
|
static NamespaceKey |
createKeyFromString(java.lang.String stringRep)
Create a key from a String representation.
|
boolean |
equals(java.lang.Object obj) |
boolean |
equals(java.lang.String uri,
java.lang.String name)
Return true if the key is equal to another key defined by its name and namespace.
|
java.lang.String |
getName()
Return the name
|
java.lang.String |
getStringRepresentation()
Return a String representation of the key.
|
java.net.URI |
getURI()
Return the URI
|
int |
hashCode() |
boolean |
hasURI()
Return true if the key has an URI.
|
boolean |
isKey(java.lang.String name)
Return true if the key is equal to another key defined by its name (with no namespace).
|
boolean |
isKey(java.lang.String uri,
java.lang.String name)
Return true if the key is equal to another key defined by its name and namespace.
|
NamespaceKey |
stripNamespace()
Return a new NamespaceKey without the namespace part.
|
java.lang.String |
toString()
Return a String representation of the key.
|
public NamespaceKey(java.net.URI uri, java.lang.String name)
uri
- the URIname
- the namepublic NamespaceKey(java.lang.String uri, java.lang.String name) throws java.net.URISyntaxException
uri
- the URIname
- the namejava.net.URISyntaxException
- if the uri is not validpublic NamespaceKey(java.lang.String name)
name
- the namepublic static NamespaceKey createKey(java.lang.String name)
name
- the namepublic static NamespaceKey createKeyFromString(java.lang.String stringRep)
stringRep
- the string representation of the keypublic static NamespaceKey createKey(java.lang.String uri, java.lang.String name)
uri
- the URI as a Stringname
- the namepublic boolean isKey(java.lang.String name)
name
- the other key namepublic boolean isKey(java.lang.String uri, java.lang.String name)
uri
- the other key namespacename
- the other key namepublic boolean equals(java.lang.String uri, java.lang.String name)
uri
- the other key namespacename
- the other key namepublic java.lang.String getName()
public java.net.URI getURI()
public boolean hasURI()
public NamespaceKey stripNamespace()
public java.lang.String getStringRepresentation()
public java.lang.String toString()
getStringRepresentation()
.toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int compareTo(NamespaceKey o)
compareTo
in interface java.lang.Comparable<NamespaceKey>
Copyright ©2017-2023 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence