public abstract class AbstractResourceValidator extends AbstractValidator
AbstractValidator
to provide useful
helper methods when validating implementations that must provide both a name and a description
for things from a resource bundle. The assumption made here is that each item tested will have
two entries in the resource bundle with keys of the form [prefix]-name
and [prefix]-desc
.
If either key is missing, or if either value (trimmed of whitespace) is an empty string, an error should
be added to the accumulated list of issues.Constructor and Description |
---|
AbstractResourceValidator() |
Modifier and Type | Method and Description |
---|---|
protected void |
addEmptyDescError(String keyPrefix)
Adds an error to the issue list stating that [keyPrefix]-desc is an empty resource.
|
protected void |
addEmptyDescError(String keyPrefix,
String footnote)
Adds an error to the issue list stating that [keyPrefix]-desc is an empty resource.
|
protected void |
addEmptyNameError(String keyPrefix)
Adds an error to the issue list stating that [keyPrefix]-name is an empty resource.
|
protected void |
addEmptyNameError(String keyPrefix,
String footnote)
Adds an error to the issue list stating that [keyPrefix]-name is an empty resource.
|
protected void |
addMissingDescError(String keyPrefix)
Adds an error to the issue list stating that [keyPrefix]-desc is a missing resource.
|
protected void |
addMissingDescError(String keyPrefix,
String footnote)
Adds an error to the issue list stating that [keyPrefix]-desc is a missing resource.
|
protected void |
addMissingNameError(String keyPrefix)
Adds an error to the issue list stating that [keyPrefix]-name is a missing resource.
|
protected void |
addMissingNameError(String keyPrefix,
String footnote)
Adds an error to the issue list stating that [keyPrefix]-name is a missing resource.
|
addError, addInfo, addVerbatim, addWarning, getMessages, getMessagesAsString, nullOrEmpty, numberOfMessages, throwException, throwException, throwException, throwExceptionIfMessages
protected void addEmptyNameError(String keyPrefix)
keyPrefix
- the prefix to the resource bundle keyprotected void addMissingNameError(String keyPrefix)
keyPrefix
- the prefix to the resource bundle keyprotected void addEmptyDescError(String keyPrefix)
keyPrefix
- the prefix to the resource bundle keyprotected void addMissingDescError(String keyPrefix)
keyPrefix
- the prefix to the resource bundle keyprotected void addEmptyNameError(String keyPrefix, String footnote)
keyPrefix
- the prefix to the resource bundle keyfootnote
- an optional note to tag onto the end of the error messageprotected void addMissingNameError(String keyPrefix, String footnote)
keyPrefix
- the prefix to the resource bundle keyfootnote
- an optional note to tag onto the end of the error messageprotected void addEmptyDescError(String keyPrefix, String footnote)
keyPrefix
- the prefix to the resource bundle keyfootnote
- an optional note to tag onto the end of the error messageprotected void addMissingDescError(String keyPrefix, String footnote)
keyPrefix
- the prefix to the resource bundle keyfootnote
- an optional note to tag onto the end of the error messageCopyright © 2015. All Rights Reserved.