public class Rfc3188Validator extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BAD_COUNTRY_CODE
Two digit country code is not in ISO 3106 list
|
static int |
EMPTY_NBN_STRING
Assigned NBN string can not be empty
|
static int |
EMPTY_SUBNAMESPACE
Sub-Namespace Code can not be empty
|
static int |
INVALID_CHAR_NBN
Not allowed Character in NBN String
|
static int |
INVALID_CHAR_NID
Not allowed Character in Namespace
|
static String[] |
iso3106Codes
All two digit country codes according to ISO 3166
"http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm"
|
static int |
MUST_START_WITH_URN
NID must start with URN:.
|
static int |
NID_TOO_SHORT
NID too short.
|
static int |
NOT_A_NBN
Only NBNs are allowed
|
static int |
NOT_TWO_DIGIT_CODE
Only two digit country codes defined in ISO 3106 are allowed
|
static int |
PART_COUNT_TOO_LOW
NID must have at least 4 parts.
|
static int |
URN_EQUALS_NULL
URN is NULL
|
static int |
URN_IS_EMPTY
URN is empty
|
static int |
URN_IS_VALID
URN is VALID
|
static char[] |
VALID_CHARS
All in URN:NBN allowed characters
|
| Constructor and Description |
|---|
Rfc3188Validator() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
charsValid(String str)
Check if only allowed chars are used.
|
static int |
validateUrn(String urn)
Method to check if the given URN satisfies the syntax defined in RFC 2141.
|
public static String[] iso3106Codes
public static final char[] VALID_CHARS
public static final int URN_IS_VALID
public static final int URN_EQUALS_NULL
public static final int URN_IS_EMPTY
public static final int NID_TOO_SHORT
public static final int PART_COUNT_TOO_LOW
public static final int MUST_START_WITH_URN
public static final int NOT_A_NBN
public static final int NOT_TWO_DIGIT_CODE
public static final int BAD_COUNTRY_CODE
public static final int EMPTY_SUBNAMESPACE
public static final int EMPTY_NBN_STRING
public static final int INVALID_CHAR_NID
public static final int INVALID_CHAR_NBN
public static int validateUrn(String urn)
urn - A National Bibliography Number as Uniform Resource Name according to RFC 3188.public static boolean charsValid(String str)
str - String to test.Copyright © 2014 Deutsche Nationalbibliothek / German National Library. All rights reserved.