public class VerhoeffIdentifierValidator extends BaseHyphenatedIdentifierValidator
Constructor and Description |
---|
VerhoeffIdentifierValidator() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAllowedCharacters() |
protected int |
getCheckDigit(java.lang.String undecoratedIdentifier) |
java.lang.String |
getName() |
java.lang.String |
getValidIdentifier(java.lang.String undecoratedIdentifier)
Override to disallow identifiers that are not exactly VERHOEFF_UNDECORATED_ID_LENGTH long.
|
boolean |
isValid(java.lang.String identifier)
Override to disallow numeric check digits and identifiers that are not exactly
VERHOEFF_ID_LENGTH long.
|
checkAllowedIdentifier
public java.lang.String getAllowedCharacters()
getAllowedCharacters
in interface IdentifierValidator
getAllowedCharacters
in class BaseHyphenatedIdentifierValidator
BaseHyphenatedIdentifierValidator.getAllowedCharacters()
public java.lang.String getName()
getName
in interface IdentifierValidator
getName
in class BaseHyphenatedIdentifierValidator
BaseHyphenatedIdentifierValidator.getName()
protected int getCheckDigit(java.lang.String undecoratedIdentifier)
getCheckDigit
in class BaseHyphenatedIdentifierValidator
BaseHyphenatedIdentifierValidator.getCheckDigit(java.lang.String)
public boolean isValid(java.lang.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 java.lang.String getValidIdentifier(java.lang.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 Inc.. All Rights Reserved.