com.h3c.util

## Class AbstractResourceValidator

- java.lang.Object
- - com.h3c.util.AbstractValidator
  - - com.h3c.util.AbstractResourceValidator

-     public abstract class AbstractResourceValidator
      extends AbstractValidator

  This class extends the base functionality of `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 Summary

    Constructors
    Constructor and Description
    `AbstractResourceValidator()`

  - ### Method Summary

    Methods
    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.

    - ### Methods inherited from class com.h3c.util.AbstractValidator

      `addError, addInfo, addVerbatim, addWarning, getMessages, getMessagesAsString, nullOrEmpty, numberOfMessages, throwException, throwException, throwException, throwExceptionIfMessages`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractResourceValidator

          public AbstractResourceValidator()

  - ### Method Detail

    - #### addEmptyNameError

          protected void addEmptyNameError(String keyPrefix)

      Adds an error to the issue list stating that [keyPrefix]-name is an empty resource.
      Parameters:
        `keyPrefix` - the prefix to the resource bundle key

    - #### addMissingNameError

          protected void addMissingNameError(String keyPrefix)

      Adds an error to the issue list stating that [keyPrefix]-name is a missing resource.
      Parameters:
        `keyPrefix` - the prefix to the resource bundle key

    - #### addEmptyDescError

          protected void addEmptyDescError(String keyPrefix)

      Adds an error to the issue list stating that [keyPrefix]-desc is an empty resource.
      Parameters:
        `keyPrefix` - the prefix to the resource bundle key

    - #### addMissingDescError

          protected void addMissingDescError(String keyPrefix)

      Adds an error to the issue list stating that [keyPrefix]-desc is a missing resource.
      Parameters:
        `keyPrefix` - the prefix to the resource bundle key

    - #### addEmptyNameError

          protected void addEmptyNameError(String keyPrefix,
                               String footnote)

      Adds an error to the issue list stating that [keyPrefix]-name is an empty resource.
      Parameters:
        `keyPrefix` - the prefix to the resource bundle key
        `footnote` - an optional note to tag onto the end of the error message

    - #### addMissingNameError

          protected void addMissingNameError(String keyPrefix,
                                 String footnote)

      Adds an error to the issue list stating that [keyPrefix]-name is a missing resource.
      Parameters:
        `keyPrefix` - the prefix to the resource bundle key
        `footnote` - an optional note to tag onto the end of the error message

    - #### addEmptyDescError

          protected void addEmptyDescError(String keyPrefix,
                               String footnote)

      Adds an error to the issue list stating that [keyPrefix]-desc is an empty resource.
      Parameters:
        `keyPrefix` - the prefix to the resource bundle key
        `footnote` - an optional note to tag onto the end of the error message

    - #### addMissingDescError

          protected void addMissingDescError(String keyPrefix,
                                 String footnote)

      Adds an error to the issue list stating that [keyPrefix]-desc is a missing resource.
      Parameters:
        `keyPrefix` - the prefix to the resource bundle key
        `footnote` - an optional note to tag onto the end of the error message

Copyright © 2014. All Rights Reserved.