public final class URN extends Object
PluginDocument that stores references
to other documents, it is essential to serialize the URN of the referenced document using toXML(String).| Modifier and Type | Field and Description |
|---|---|
String |
assigner
Name of organization assigning names for this URN.
|
String |
element
The specified media element.
|
String |
namespace
The name of the organization which defines the rules on name allocation for this URN.
|
| Constructor and Description |
|---|
URN(String urnString)
URN factory method.
|
URN(String namespace,
String assigner,
String element)
Construct a URN.
|
URN(URN urnToCopy)
Constructs a copy of this URN.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object object)
Returns true if this URN and the object argument represent the same
URN.
|
static URN |
fromXML(org.jdom.Element urnElement)
Convert back to URN from element generated by
toXML(String). |
static URN |
generateUniqueLocalURN()
Generates a local unique URN with an
assigner of ".". |
static URN |
generateUniqueLocalURN(String assigner)
Generates a unique URN
|
int |
hashCode()
Returns the hash code of the string representation of this object.
|
boolean |
isLocal() |
String |
toString()
Returns the full URN as a string.
|
org.jdom.Element |
toXML(String elementName)
Convert a URN into a XML element.
|
org.jdom.Element |
toXMLAsWeakReference(String elementName)
Convert a URN into a XML element.
|
public final String namespace
public final String assigner
public final String element
public URN(URN urnToCopy)
AnnotatedPluginDocument associated with this URN
can become eligible for garbage collection. As long as the URN returned from
AnnotatedPluginDocument.getURN() is still referenced, the AnnotatedPluginDocument will never be garbage collected.
If a copy of a URN is made, the referenced document can still be retrieved from either the original URN
or the URN copy using DocumentUtilities.getDocumentByURN(URN).urnToCopy - the URN to copy.public URN(String urnString) throws MalformedURNException
URN object from the String
representation. URNs must take the form:
identifier:namespace:assigner:element
urn:sequence:ncbi:genbank/AF00001
urnString - the String to parse as a URN.MalformedURNException - If the spec String specifies an
incomplete or invalid URN.public static URN generateUniqueLocalURN()
assigner of ".".public static URN generateUniqueLocalURN(String assigner)
assigner - name of organization assigning names for this URN. This could be a user name in a shared database or just "." for a local URN. A local URN is a URN that will not be used outside of this Geneious local database.public boolean isLocal()
generateUniqueLocalURN() or generateUniqueLocalURN(String)).
All AnnotatedPluginDocuments have a local URN, including those in a shared database. Examples of non-local URNs are those returned from PluginDocument.getURN()public final String toString()
public boolean equals(Object object)
public int hashCode()
public org.jdom.Element toXML(String elementName)
PluginDocument#toElement). Failure to use this method for serializing URNs means that Geneious
won't recognize the document references another document and the referenced document
could potentially be deleted by the user meaning the referencing document will no longer
be able to find its referenced document.
toXMLAsWeakReference(String) instead.
URNs can be assumed to never change their XML format for the purposes of XMLSerializable.OldVersionCompatible.elementName - name to use for element.fromXML(org.jdom.Element)public org.jdom.Element toXMLAsWeakReference(String elementName)
toXML(String) except that core Geneious will treat the references slightly differently. Weakly referenced documents are not
included when exporting the referencing document. Any weakly referenced documents are not reference counted in the database and kept around as long as something references them.
URNs can be assumed to never change their XML format for the purposes of XMLSerializable.OldVersionCompatible.elementName - name to use for element.fromXML(org.jdom.Element)public static URN fromXML(org.jdom.Element urnElement) throws MalformedURNException
toXML(String).urnElement - URN elementMalformedURNException - when element has the wrong form or is nulltoXML(String)