edu.ucsb.nceas.metacat

## Class DocumentIdentifier

- java.lang.Object
- - edu.ucsb.nceas.metacat.DocumentIdentifier

-     public class DocumentIdentifier
      extends java.lang.Object

  A class to parse document ids The docid is of the form siteCode.uniqueId.rev

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DocumentIdentifier(java.lang.String docid)` Constructor to build a docid object and parse an incoming string.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getIdentifier()` returns
    `java.lang.String` | `getRev()` returns the revision number encoded in this docid
    `java.lang.String` | `getSeparator()` returns the separator used in the accession number
    `java.lang.String` | `getSiteCode()` returns the siteCode encoded in this docid
    `java.lang.String` | `getUniqueId()` returns the uniqueId encoded in this docid
    `static void` | `main(java.lang.String[] args)` Test driver.
    `java.lang.String` | `toString()` returns the whole docid as a string

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DocumentIdentifier

          public DocumentIdentifier(java.lang.String docid)
                             throws AccessionNumberException

      Constructor to build a docid object and parse an incoming string.
      Throws:
        `AccessionNumberException`

  - ### Method Detail

    - #### getRev

          public java.lang.String getRev()

      returns the revision number encoded in this docid

    - #### getUniqueId

          public java.lang.String getUniqueId()

      returns the uniqueId encoded in this docid

    - #### getSiteCode

          public java.lang.String getSiteCode()

      returns the siteCode encoded in this docid

    - #### getSeparator

          public java.lang.String getSeparator()

      returns the separator used in the accession number

    - #### getIdentifier

          public java.lang.String getIdentifier()

      returns

    - #### toString

          public java.lang.String toString()

      returns the whole docid as a string
      Overrides:
        `toString` in class `java.lang.Object`

    - #### main

          public static void main(java.lang.String[] args)

      Test driver. The first command line argument is the docid you want to create an object for. For instance ">java DocumentIdentifer nceas.1.2" will return "rev: 2 \n uniqueId: 1 \n siteCode: nceas \n"

Copyright © 2023 Regents of the University of California. All Rights Reserved.