public class VerhoeffIdentifierValidator extends BaseHyphenatedIdentifierValidator
Constructor and Description |
---|
VerhoeffIdentifierValidator() |
Modifier and Type | Method and Description |
---|---|
String |
getAllowedCharacters() |
protected int |
getCheckDigit(String undecoratedIdentifier) |
String |
getName() |
String |
getValidIdentifier(String undecoratedIdentifier)
Override to disallow identifiers that are not exactly VERHOEFF_UNDECORATED_ID_LENGTH long.
|
boolean |
isValid(String identifier)
Override to disallow numeric check digits and identifiers that are not exactly
VERHOEFF_ID_LENGTH long.
|
checkAllowedIdentifier
public String getAllowedCharacters()
getAllowedCharacters
in interface IdentifierValidator
getAllowedCharacters
in class BaseHyphenatedIdentifierValidator
BaseHyphenatedIdentifierValidator.getAllowedCharacters()
public String getName()
getName
in interface IdentifierValidator
getName
in class BaseHyphenatedIdentifierValidator
BaseHyphenatedIdentifierValidator.getName()
protected int getCheckDigit(String undecoratedIdentifier)
getCheckDigit
in class BaseHyphenatedIdentifierValidator
BaseHyphenatedIdentifierValidator.getCheckDigit(java.lang.String)
public boolean isValid(String identifier) throws UnallowedIdentifierException
isValid
in interface IdentifierValidator
isValid
in class BaseHyphenatedIdentifierValidator
identifier
- The Identifier to check.UnallowedIdentifierException
- if the identifier contains unallowed characters or is
otherwise not appropriate for this validator.BaseHyphenatedIdentifierValidator.isValid(java.lang.String)
public String getValidIdentifier(String undecoratedIdentifier) throws UnallowedIdentifierException
getValidIdentifier
in interface IdentifierValidator
getValidIdentifier
in class BaseHyphenatedIdentifierValidator
undecoratedIdentifier
- The identifier prior to being given a check digit or other form
of validation.UnallowedIdentifierException
- if the identifier contains unallowed characters or is
otherwise not appropriate for this validator.BaseHyphenatedIdentifierValidator.getValidIdentifier(java.lang.String)
Copyright © 2018 OpenMRS LLC.. All Rights Reserved.