public abstract class BaseHyphenatedIdentifierValidator extends Object implements IdentifierValidator
Constructor and Description |
---|
BaseHyphenatedIdentifierValidator() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkAllowedIdentifier(String undecoratedIdentifier) |
abstract String |
getAllowedCharacters() |
protected abstract int |
getCheckDigit(String undecoratedIdentifier) |
abstract String |
getName() |
String |
getValidIdentifier(String undecoratedIdentifier) |
boolean |
isValid(String identifier) |
protected abstract int getCheckDigit(String undecoratedIdentifier)
public abstract String getAllowedCharacters()
getAllowedCharacters
in interface IdentifierValidator
IdentifierValidator.getAllowedCharacters()
public abstract String getName()
getName
in interface IdentifierValidator
IdentifierValidator.getName()
public String getValidIdentifier(String undecoratedIdentifier) throws UnallowedIdentifierException
getValidIdentifier
in interface IdentifierValidator
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.IdentifierValidator.getValidIdentifier(java.lang.String)
public boolean isValid(String identifier) throws UnallowedIdentifierException
isValid
in interface IdentifierValidator
identifier
- The Identifier to check.UnallowedIdentifierException
- if the identifier contains unallowed characters or is
otherwise not appropriate for this validator.IdentifierValidator.isValid(java.lang.String)
protected void checkAllowedIdentifier(String undecoratedIdentifier) throws UnallowedIdentifierException
undecoratedIdentifier
- UnallowedIdentifierException
- if identifier contains unallowed characters or is
otherwise invalid.Copyright © 2018 OpenMRS LLC.. All Rights Reserved.