Package org.gbif.api.model.common
Class DOI
java.lang.Object
org.gbif.api.model.common.DOI
- All Implemented Interfaces:
Serializable
Class representing a single Digital Object Identifier (DOI) breaking it down to a prefix and suffix.
For the syntax of DOI names see the DOI Handbook.
All parsing is case-insensitive and resulting components will all be uppercased.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
getUrl()
int
hashCode()
static boolean
isParsable
(String source) Returns true only if the source can be parsed into a DOI.void
void
toString()
-
Field Details
-
GBIF_PREFIX
The DOI prefix registered with DataCite to be used by GBIF-issued production DOIs.- See Also:
-
TEST_PREFIX
A DOI prefix provided by DataCite to be used in tests.- See Also:
-
-
Constructor Details
-
DOI
public DOI()Do not use this constructor. Required by JAXB to marshall this object without introducing adapters. -
DOI
Parses a simple DOI string of various forms incl URN, URL or plain DOI names.- Parameters:
doi
- the full simple DOI string- Throws:
IllegalArgumentException
- if invalid DOI string is passed
-
DOI
Parses a simple DOI string of various forms incl URN, URL or plain DOI names.- Parameters:
prefix
- a simple DOI prefix starting with 10.suffix
- arbitrary suffix part of the DOI- Throws:
IllegalArgumentException
- if invalid DOI prefix is given
-
-
Method Details
-
isParsable
Returns true only if the source can be parsed into a DOI. -
getPrefix
-
setPrefix
-
getSuffix
-
setSuffix
-
getUrl
- Returns:
- the resolved DOI using https://doi.org/
- Throws:
IllegalStateException
- if the encoding of the DOI is not supported
-
getDoiString
- Returns:
- the DOI name prefixed with "doi:", as recommended by the DOI Handbook.
-
getDoiName
- Returns:
- the pure DOI name without any initial scheme name starting with the prefix, i.e. 10.
-
toString
-
hashCode
-
equals
-